Originally Posted by
d_stranz
So, how are you creating your instance of myWidget? As a child of your QMainWindow or of the QStackedWidget? In that case, it is probably being shown but is hidden behind the main window or stacked widget.
If you want your myWindow instance to be free-floating, then you need to create it as a top-level widget (i.e. with a NULL parent) and call its show() method to make it visible. It will be free-floating and completely independent of your main window, so it is possible that when it is shown, it will actually be behind the main window and you will have to move the main window to be able to see it. That could be what is happening now.
The reason your two widgets are being shown independently with your current code is that even though you are adding them to a layout, you aren't putting that layout into any widget. So when you call show() on those sub-widgets, they essentially get re-parented (with NULL parents) as top-level widgets, ignoring the layout.
If myWidget is free-floating, it can be anywhere on the screen and won't be confined to the area of the main window.