[Qt-interest] How to close QMainWindow and open login dialog

Aditya Sharma 88aditya88 at gmail.com
Fri Aug 7 16:25:29 CEST 2009


The problem goes like this,
In an application I am building, I have one instance of LoginDialog
inherited from QDialog. This takes username and password, if match is not
found in the mysql database, the loginvalidate() returns 0. Return type of
loginValidate of LoginDialog is used to determine whether or not to exit the
program from the event loop in the main function. If match is found, program
flow is as usual, opens the main window.

Now here comes the problem. I have logout button in the QMainWindow
inherited class. When it is clicked, private slot, logout() is called, in
the logout() slot, i can write close() to close the current instance of
QMainWindow, but how can I show to login dialog, Well, making a new object
newlogin will help but still, slots in the LoginDialog won't call
QMainWindow. What can I do.

THank you in advance.


Advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090807/8b435fc8/attachment.html 


More information about the Qt-interest-old mailing list