c++ - Returning the values of a table view in one window to a line edit in another -


the following code used me in order send value in table view in 1 window line edit in window. error! how can correct it?

void firstwindow::on_tableview_activated(const qmodelindex &index) {      qstring val=ui->tableview->model()->data(index).tostring();     firstwindow conn;      conn.connopen();     qsqlquery qry;     qry.prepare("select message_id message  message_id='"+val+"'");     if(qry.exec())     {         while(qry.next())         {            window2 a;            ui->message->settext(qry.value(0).tostring());      } }       conn.connclose();   } 

here firstwindow 1 class has connopen() method connect database( works properly), when user clicks row retrieved database want appear in line edit named message in window belongs class named window2. error stating message not member of firstwindow class! how can correct issue?


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -