C++ (Qt)connect (button, SIGNAL (clicked ()), this, SLOT (showDialog ()));.......................void MainWindow::showDialog (){ YourDialog d (this); if (d.exec ()) { const QString plaintext = d.plaintext (); }}
Ui::Form *win=new Ui::Form; QWidget *widget = new QWidget; win->setupUi(widget); widget->show(); QEventLoop loop(this); connect(win->pushButton, SIGNAL(clicked()), &loop, SLOT(quit())); loop.exec();