QWidget->close() doesn't actually close the QWidget
I have an application with many windows (QWidgets).
Particularly, each of these windows is called here SubWindow. Every SubWindow class contains a layout with a MultiEditor *sEditors, which has a menu with an action that closes the current window. Every SubWindow is created within the MainWindow.
In the SubWindow constructor I have:
Code:
connect(sEditors, SIGNAL(closeWindow()), this, SLOT(close()));
connect(this, SIGNAL(destroyed()), mainWindow, SLOT(closeWindow()));
The code actually works, as the slot closeWindow() is triggered. But the SubWindow doesn't disappear and remains visible.
Has anybody something to suggest me? I don't understand what actually the problem is (neither hide() seems to work).
Thanks!
Re: QWidget->close() doesn't actually close the QWidget
This is strange.
Are you triggering the closeWindow() slot elsewhere?
Because destroyed() is a signal of QObject so the widget destructor has already finished by then.
There should be no visual resource left at this point.
Cheers,
_