Results 1 to 2 of 2

Thread: visible main form?

  1. #1
    Join Date
    Dec 2007
    Posts
    129
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default visible main form?

    hi.

    i create a form main and form for login, at the start of the program i will call the login form then if ok enable main form or if cancel exit..

    my problem is when i call the form login in class constructor at the start of the program, i only see the login form without the main form. what i want is to see both at the start of the program but login form as modal. how?

    tnks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: visible main form?

    Qt Code:
    1. int main(...){
    2. QApplication app(...);
    3. MainWindow mw;
    4. mw.show();
    5. QTimer::singleShot(0, &mw, SLOT(displayLogin());
    6. return app.exec();
    7. }
    8.  
    9. class MainWindow ... {
    10. ...
    11. public slots:
    12. void displayLogin(){
    13. LoginDialog dlg(this);
    14. dlg.exec();
    15. }
    16. };
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to wysota for this useful post:

    triperzonak (12th June 2008)

Similar Threads

  1. Qt Designer - Fixed size main form
    By nleverin in forum Newbie
    Replies: 3
    Last Post: 25th April 2008, 19:54
  2. Replies: 4
    Last Post: 10th March 2007, 18:01
  3. Replies: 1
    Last Post: 28th July 2006, 14:10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.