The window is closed but it is still there and it is still top-level. Either delete it or filter out windows that are not visible (QWidget::visible).
The window is closed but it is still there and it is still top-level. Either delete it or filter out windows that are not visible (QWidget::visible).
O.k , so if I have this right , closing a windows does not delete it is a top level widget , it just deletes it from the display ? , so instead of making a new window each time, should I just reopen the same one ?
It doesn't delete anything. It just hides the window. Yes, you can reopen it at any time.
o.k , Thanks !!!
I`ve found have to delete it now with :- My_dialog->setAttribute(Qt::WA_DeleteOnClose);
So what is the right way to reopen a window ? , I can find any handles to save and use again ..
The only way I can think of is to look at the top level widgets until I see the right windows title or other marker, then open it.
In this bit of code:
You create the dialog object on the heap and then allow the local variable that you stored the pointer in to go out of scope. If you put that address into a member variable instead you could access that object from other places in the code (to call exec(), show() or delete the object).Qt Code:
void myQtApp::Log_in_clicked() { Password * My_dialog = new Password; My_dialog->setWindowFlags(Qt::FramelessWindowHint ); My_dialog->move(0,0); My_dialog->exec(); }To copy to clipboard, switch view to plain text mode
Thanks , at this time that makes no sense to me right now , but you have given me some good key word to work it out.
NEWBIE !!!! Any chance of giving me a example to work off Please
Last edited by peter a; 17th September 2010 at 12:49.
Bookmarks