Answer the question
In order to leave comments, you need to log in
Is it possible to close one main window and open a new one (Qt)?
Hello!
There is a main window in which authorization takes place. I would like that after successful authorization (after the login and password verification stage), the first window closes and a new one opens.
The class of the first window is called WelcomeWindow, and the class of the second window is called MainWindow. Both of them were created in Qt as main ones.
How to implement it? I tried to prescribe in WelcomeWindow:
MainWindow mw;
mw.show();
Answer the question
In order to leave comments, you need to log in
We set the window attribute
Qt::WA_QuitOnClose ( www.doc.crossplatform.ru/qt/4.7.x/qt.html#WidgetAt... ) to false so that the application does not close after the window is closed.
doc.qt.io/qt-4.8/qwidget.html#setAttribute
Excuse me, but why do you need two main windows? What did the same QDialog as the basis of the login form not please?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question