DIALOG:
Extract from the constructor of dialog:
setWindowFlags(Qt::WindowTitleHint | Qt::Dialog | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint | Qt::CustomizeWindowHint);
setModal(false);
setWindowFlags(Qt::WindowTitleHint | Qt::Dialog | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint | Qt::CustomizeWindowHint);
setModal(false);
To copy to clipboard, switch view to plain text mode
cpp:
{
emit closing(true);
}
void FindDialog::closeEvent(QCloseEvent *e)
{
emit closing(true);
QDialog::closeEvent(e);
}
To copy to clipboard, switch view to plain text mode
h:
protected:
signals:
void closing(bool visible);
protected:
void closeEvent(QCloseEvent *e);
signals:
void closing(bool visible);
To copy to clipboard, switch view to plain text mode
MAIN WINDOW:
cpp:
findDialog = new FindDialog;
findDialog->setVisible(false);
findDialog->setMeasurements(&measurements);
connect(findDialog, SIGNAL(closing(bool)), this, SLOT(setShown(bool)));
findDialog = new FindDialog;
findDialog->setVisible(false);
findDialog->setMeasurements(&measurements);
connect(findDialog, SIGNAL(closing(bool)), this, SLOT(setShown(bool)));
To copy to clipboard, switch view to plain text mode
h:
FindDialog *findDialog;
FindDialog *findDialog;
To copy to clipboard, switch view to plain text mode
Even if I change setShown to setFocus it doesn't make any difference.
How could I get back the focus to main window? It is crucial if user meanwhile activated a different application and then clicked back on dialog and closes it...
findDialog->setVisible(true); is called when a menu item is triggered.
Bookmarks