window disappears when minimized, on windows 10
-
I've created multiple windows that opens on push button click while hiding the current active window. The issue is that, whenever I click the minimize or close button of the window, the window disappears.
Clicking minimize doesn't dock the window to the taskbar and clicking the close button is not quitting the app with exit code 0.
All the new windows that I've created are having the QMainWindow base class. Is there any additional setup needed for using the minimize or quit button to actually do what they are supposed to do?And, the minimize and close functions are working properly for the MainWindow that is created along with the new project, and isn't working on the new windows created afterwards.
also, this is how I'm opening new windows from the active one, inside the push button clicked slot
hide(); secondWindow = new SecondWindow(this); secondWindow->show();
thanks
-
I've created multiple windows that opens on push button click while hiding the current active window. The issue is that, whenever I click the minimize or close button of the window, the window disappears.
Clicking minimize doesn't dock the window to the taskbar and clicking the close button is not quitting the app with exit code 0.
All the new windows that I've created are having the QMainWindow base class. Is there any additional setup needed for using the minimize or quit button to actually do what they are supposed to do?And, the minimize and close functions are working properly for the MainWindow that is created along with the new project, and isn't working on the new windows created afterwards.
also, this is how I'm opening new windows from the active one, inside the push button clicked slot
hide(); secondWindow = new SecondWindow(this); secondWindow->show();
thanks
@febinaf
This may come because the parent of your secondary windows is hidden?I am guessing that minimize on a secondary window child is supposed to hide it with respect to its parent, but that is hidden, so maybe there is nowhere to show it minimized? Similarly "minimizing to the taskbar" may only happen when the original, top-level window is minimized, which is not happening here? You might compare behaviour if you create
secondWindow = new SecondWindow(nullptr);
.By default (unless you alter it) a Qt GUI application show close when the last visible window is closed.
I don't think there is any relevance to using
QMainWindow
, once or multiple times, it is only a window style. -
@febinaf
This may come because the parent of your secondary windows is hidden?I am guessing that minimize on a secondary window child is supposed to hide it with respect to its parent, but that is hidden, so maybe there is nowhere to show it minimized? Similarly "minimizing to the taskbar" may only happen when the original, top-level window is minimized, which is not happening here? You might compare behaviour if you create
secondWindow = new SecondWindow(nullptr);
.By default (unless you alter it) a Qt GUI application show close when the last visible window is closed.
I don't think there is any relevance to using
QMainWindow
, once or multiple times, it is only a window style. -
-
@JonB said in window disappears when minimized, on windows 10:
You might compare behaviour if you create secondWindow = new SecondWindow(nullptr);
Hey that solved the issue and thanks a lot.