Closing an instance of QMainWindow?
Solved
General and Desktop
-
I want to programmatically close an instance of QMainWindow, I have a pointer to the widget associated with the window and I've tried calling the close function, it doesn't close the window and it remains visible.
I've also tried casting the widget pointer to QMainWindow:
QMainWindow* pobjWindow = static_cast<QMainWindow*>(pobjWidget); pobjWindow->close();
I've single stepped this in the debugger to verify the pointer isn't nullptr, it doesn't close.
-
Hi,
Maybe a silly question but: are you sure you are closing the instance you think you are closing ?
By the way, you should rather use qobject_cast.
-
Hi,
Maybe a silly question but: are you sure you are closing the instance you think you are closing ?
By the way, you should rather use qobject_cast.
-
Hi
Please dont delete posts.
Just flag it as solved.