c++ - Working with two user interfaces - Qt 5.5 -
i have simple mainwindow
has button , lineedit
. when type , click button, new dialog
appears label supposed display string typed. basically, have trouble sending information ui. tried working new class string variable, didn't work.
i try give example of want do.
//ui2 dialog ui2->label->settext(ui->lineedit->text());
ui private variable, it's not accessible class.
//mainwindow.cpp mainwindow::mainwindow(qwidget*){ this->_dialog = new dialog(this); //... } mainwindow::on_pushbutton_clicked(){ _dialog->_labe->settext(ui->lineedit->text()); } //dialog.h class dialog{ public: qlabel* _label; dialog(qwidget* ){ _label = ui->label; } }
Comments
Post a Comment