The easiest way I can think of to do this is to pass a pointer to the parent window to NewWindow, and use the pointer to call a function in MainWindow in the destructor of NewWindow.
Something like:
NewWindow
::NewWindow(QWidget* parent
){
// Whatever
}
~NewWindow::NewWindow()
{
(MainWindow*)parentWidget()->WindowClosed();
}
NewWindow::NewWindow(QWidget* parent)
: QWidget(parent)
{
// Whatever
}
~NewWindow::NewWindow()
{
(MainWindow*)parentWidget()->WindowClosed();
}
To copy to clipboard, switch view to plain text mode
You could then implement WindowClosed() something like this:
void MainWindow::WindowClosed()
{
childWindowClosed = true;
}
void MainWindow::WindowClosed()
{
childWindowClosed = true;
}
To copy to clipboard, switch view to plain text mode
If there's a better way to do this, someone else might chime in.
Bookmarks