Results 1 to 3 of 3

Thread: Creating Login page

  1. #1
    Join Date
    Apr 2009
    Posts
    61
    Thanks
    4
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Creating Login page

    Hi

    I am new to Qt ..

    I am creating Login page ...

    If click submit button , it has go to another window or Widget...


    So please suggest me ,How do set the submit button according to go to next page....


    Thanks

    Yuvaraj R

  2. #2
    Join Date
    Jul 2007
    Location
    Bangalore, India
    Posts
    13
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Creating Login page

    hello,

    use the signal and slots to connect to the subwindow or a widget

    this in your login window

    e.g
    connect( your_submit_button, SIGNAL(clicked()), this, SLOT(you_sub_window_slot())) )

  3. #3
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Creating Login page

    Here is one of such solutions:

    1. QDialog has accept() and reject() methods
    2. On your LoginDialog you input your credentials and press a button (let it be submitButton) and it emits a SIGNAL called clicked().
    3. Create a slot: submitButtonClicked(). Connect a signal clicked() to a slot submitButtonClicked()
    4. Inside your slot do your validations for received credentials and if everthing is ok call accept() method, otherwise - reject().

    And using it will look like this
    Qt Code:
    1. YourLoginDialog loginDialog;
    2. if ( QDialog::Accepted == logindDialog.exec() ) {
    3. // access granted, do you work
    4. } else {
    5. // sorry access denied
    6. }
    To copy to clipboard, switch view to plain text mode 
    I'm a rebel in the S.D.G.

Similar Threads

  1. Best way to open a Qt window from web page?
    By montylee in forum Qt Programming
    Replies: 9
    Last Post: 19th January 2009, 08:04
  2. Creating And Destoying composite Widgets
    By morraine in forum Newbie
    Replies: 3
    Last Post: 31st August 2008, 16:57
  3. page faults
    By moowy in forum General Programming
    Replies: 2
    Last Post: 20th January 2007, 14:13
  4. QWidget display on 2 stack widget page
    By spawnwj in forum Qt Programming
    Replies: 3
    Last Post: 4th September 2006, 12:07

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.