How to avoid displaying QMainWindow
General and Desktop
4
Posts
4
Posters
2.0k
Views
1
Watching
-
Hi All
I have created QApplication project.
In the constructor I am doing some condition checking and on failure
that condition i am poping up error message with OK button .
so when the user clicks OK button my MainWindow should not open.
How to do this? -
It is not clear what "should not open" means. If you don't want to start (i.e., load and initialize) the mainwindow then you have to do your check before the window is created (i.e., in the main) and then do a simple if statement. If you mean that the window should be not visible, than in the constructor you can call setVisible with the result of your condition.