void MainWindow::onViewLog() { Connection *con = configHelper->connectionAt(ui->connectionView->currentIndex().row()); LogDialog *logDlg = new LogDialog(con, this); connect(logDlg, &LogDialog::finished, logDlg, &LogDialog::deleteLater); logDlg->exec(); }
void MainWindow::onViewLog() { Connection *con = model->getItem(proxyModel->mapToSource(ui->connectionView->currentIndex()).row())->getConnection(); LogDialog *logDlg = new LogDialog(con, this); connect(logDlg, &LogDialog::finished, logDlg, &LogDialog::deleteLater); logDlg->exec(); }
int main(int argc, char *argv[]) { QApplication a(argc, argv); LogDialog l; //l.show(); if (l.exec() == QDialog::Accepted) { int res = QMessageBox::question(nullptr, "Method", "Wired?", QMessageBox::Yes, QMessageBox::No); bool wired = (res == QMessageBox::Yes); MainWindow w(wired); w.show(); return a.exec(); } return 0; }