signals: void Text(QString);
private slots:void changeText(QString );
void Widget::changeText(QString text){ ui->label_5->setText(text);}
void Dialog::on_pushButton_clicked(){ emit Text(ui->lineEdit->text()); auth();}
Widget w; Dialog d; QObject::connect(&d, SIGNAL(Text(QString)), &w, SLOT(changeText(QString)));
C++ (Qt) Widget w; Dialog d; QObject::connect(&d, SIGNAL(Text(QString)), &w, SLOT(changeText(QString))); ... Widget window; window.setWindowState(Qt::WindowMaximized); window.show();
QApplication app(argc, argv); Dialog * dial=new Dialog; if(dial->exec()== QDialog::Accepted) { if (!createConnection()); Widget window; QObject::connect(dial, SIGNAL(Text(QString)), &window, SLOT(changeText(QString))); window.setWindowState(Qt::WindowMaximized); window.show(); return app.exec(); }
if(dial->exec()== QDialog::Accepted)