Hi All,
I have two forms open i need to close both the forms together how this can be done any suggestions
Hi All,
I have two forms open i need to close both the forms together how this can be done any suggestions
Can you call QWidget::close
if i do that only one form will get closed and the other will be open i need to close both the forms together
Make 2nd one parent as first form and launch 2nd form as non-modal. Set the single closing slot where you are closing the parent form.
Else you can use QPrecess.
I am closing the form using keypress event if i press escape key from keyboard one of my form will be closed but i need to close both the forms together.
use installEventFilter() from parent class and in eventFilter() check for the Keypressed event and ESCAPE Character. depending on that close everything
Are your forms custom widgets ?
If yes, you can override closeEvent of your widget and call qApp->quit().
Or yet another suggestion:
Qt Code:
... a->setAttribute(Qt::WA_DeleteOnClose); b->setAttribute(Qt::WA_DeleteOnClose); connect(a, SIGNAL(destroyed()), b, SLOT(deleteLater())); connect(b, SIGNAL(destroyed()), a, SLOT(deleteLater()));To copy to clipboard, switch view to plain text mode
Bookmarks