Results 1 to 2 of 2

Thread: QMain Window Problem

  1. #1
    Join Date
    May 2008
    Posts
    27
    Qt products
    Qt4
    Platforms
    Windows

    Question QMain Window Problem

    Hi all,
    i am a newbie
    i created my application well and good, now i need to implement login window(dialog) to this application.. there are almost 12 ui already done... now i need to implement Login
    window

    for instance consider in vb.net
    there might be n number of forms we can change settings and start from our required form..

    so just like that is there any possibility in qt that i could change some settings and display my login window first->(checking validations uname/password)-> firstwindow.ui(Qmain window).....

    my login window is a QDialog and my main window is QMain window..

    now my problem is i am not able to go from this login window to main window after giving correct password and user name...
    like this....

    can any one help me out...


    thanks in advance

    this is code i tried for displaying main window from login dialog....

    Qt Code:
    1. try
    2. {
    3. QString str="*****";
    4. if(str==PlineEdit2->text()) // here PlineEdit2 is the object name for my password......
    5. {
    6. MainWind MWin(this);
    7. MWin.show();
    8. //QMessageBox::information(this, tr("My Application"), tr("successfully login."),QMessageBox::Ok);
    9. }
    10. else
    11. {
    12. //QMessageBox::information(this, tr("My Application"), tr(logmein),QMessageBox::Ok);
    13. PlineEdit2->clear();
    14. }
    15. }
    16. catch (QString str2)
    17. {
    18. QMessageBox::warning(this, tr("Error"), tr(str2),QMessageBox::Ok);
    19. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by maveric; 16th May 2008 at 11:57. Reason: spelling error

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMain Window Problem

    QWidget::show() is a non-blocking method. Your main window object goes out of scope immediately.

Similar Threads

  1. Window z-order problem
    By ChristianEhrlicher in forum Qt Programming
    Replies: 1
    Last Post: 11th March 2008, 09:19
  2. Problem hiding main window on minimize
    By bpetty in forum Newbie
    Replies: 5
    Last Post: 18th September 2007, 17:41
  3. New to QT, problem displaying main window...
    By McCall in forum Qt Programming
    Replies: 4
    Last Post: 15th June 2007, 14:27
  4. Problem in porting Main window on linux
    By jyoti kumar in forum Qt Tools
    Replies: 2
    Last Post: 2nd June 2006, 08:35

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.