void Dialog4_1::on_pushButton_50_clicked(){ QString filename = "/test/abc.exe"; QDesktopServices::openUrl(QUrl(filename));}
signals: void sendName(const QString &str);private slots: void on_pushButton_40_clicked(); void on_pushButton_41_clicked(); void okClicked();
connect(ui->pushButton_41,SIGNAL(clicked()),SLOT(okClicked()));
void Dialog4::okClicked(){ emit sendName(ui->lineEdit->text());}
public slots: void takeName();
void Dialog4::okClicked(){ emit sendName(ui->lineEdit->text());}[code]void Dialog4::on_pushButton_41_clicked(){ Dialog4_1 *d4_1wnd = new Dialog4_1(this); d4_1wnd->show(); connect(sendName,SIGNAL(QString &str),d4_1wnd->takeName,SLOT());}
{ QString str = qApp->applicationDirPath(); QDir::setCurrent(str); QProcess::startDetached("1.exe"); this->close();}
public slots: void takeName(QString);
void Dialog4::pbClicked(){ Dialog4_1 *d4_1wnd = new Dialog4_1(); d4_1wnd->show(); emit sendName(ui->lineEdit->text()); connect(this,SIGNAL(sendName(QString)),d4_1wnd,SLOT(takeName(QString))); }
Dialog4_1::Dialog4_1(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog4_1){ ui->setupUi(this); ui->lineEdit->setText(takeName(QString)); // не работает}
void Dialog4_1::takeName(QString tn){ ui->lineEdit->setText(tn);}
Dialog4_1::Dialog4_1(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog4_1){ dragwindow *drw = new dragwindow(); ui->setupUi(this); ui->horizontalLayout_2->addWidget(drw); connect(ui->pushButton_46,SIGNAL(clicked()),ui->horizontalLayout_2,SLOT(removeWidget(drw)));}