Results 1 to 2 of 2

Thread: Shrinking connection dialog

  1. #1
    Join Date
    Apr 2008
    Posts
    196
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    1

    Default Shrinking connection dialog

    Hey @all,

    in my client application i have a connection dialog where i can enter the username, passwort, hostname, port. Now i will have an Advanced Button, and by clicking of them the four fields are shown. When i click once more on the button, the four fields must hide.

    if have implement it as follows, (Drawings):
    Qt Code:
    1. this->auth_dlg->layout()->setSizeConstraint(QLayout::SetFixedSize);
    To copy to clipboard, switch view to plain text mode 
    And in the slot for the Advanced Button I have:
    Qt Code:
    1. if(this->is_advanced) {
    2. this->is_advanced = false;
    3. }
    4. else if(!this->is_advanced) {
    5. this->is_advanced = true;
    6. }
    7. auth_dlg_lServer->setVisible(this->is_advanced);
    8. auth_dlg_lPort->setVisible(this->is_advanced);
    9. auth_dlg_lUsername->setVisible(this->is_advanced);
    10. auth_dlg_lPassword->setVisible(this->is_advanced);
    11. auth_dlg_leServer->setVisible(this->is_advanced);
    12. auth_dlg_lePort->setVisible(this->is_advanced);
    13. auth_dlg_leUsername->setVisible(this->is_advanced);
    14. auth_dlg_lePassword->setVisible(this->is_advanced);
    To copy to clipboard, switch view to plain text mode 

    So my problem now is when the fields are shown/hided, it takes a few seconds (1 - 3). How can i do it faster?

    Regards
    NoRulez

  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: Shrinking connection dialog

    Wrap all the extra widgets into a single widget (QWidget or QGroupBox, depending on the effect you want to obtain) and hide/show only this one widget. Oh... and you can do that using signals/slots connection - make the "Advanced" button checkable and connect its toggled(bool) signal to widget's setVisible(bool) slot.

Similar Threads

  1. Client/Server Error: BadIDChoice
    By 3nc31 in forum Qt Programming
    Replies: 5
    Last Post: 27th November 2007, 10:22
  2. Resizing the dialog boxes
    By anju123 in forum Qt Programming
    Replies: 4
    Last Post: 14th September 2007, 10:41
  3. QGraphicsView: Dialog Position Doubt
    By arjunasd in forum Qt Programming
    Replies: 1
    Last Post: 6th August 2007, 17:48
  4. Communication between MainWindow and a dialog
    By Backslash in forum Newbie
    Replies: 9
    Last Post: 3rd August 2007, 04:27
  5. dialog box
    By Bahar in forum Qt Programming
    Replies: 3
    Last Post: 31st January 2006, 14:52

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.