Results 1 to 2 of 2

Thread: Qidget height resize if child widgets invisible

  1. #1
    Join Date
    Jun 2006
    Posts
    23
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Qidget height resize if child widgets invisible

    Hello,

    cant get good result for form height resizing , if hiding some elements
    creating form in designer, it looks like:
    Qt Code:
    1. vboxlayout1->addWidget( textbox1 );
    2. vboxlayout1->addWidget( textbox2 );
    3. vboxlayout1->addWidget( textbox3 );
    4. groupBox->addLayout(vboxlayout);
    5. hboxLayout->addWdiget( push_ok );
    6. hboxLayout->addWdiget( push_cancel );
    7. vboxlayout->addWidget( groupBox );
    8. vboxlayout->addLayout(vboxlayout);
    9. ......
    10. //in aplication settiing
    11. textbox1->setVisible(false);
    12. textbox1->setVisible(false);
    To copy to clipboard, switch view to plain text mode 
    form height is not changed, adjustsize not changing height also
    Last edited by wysota; 27th April 2008 at 12:25. Reason: Changed [qtclass] to [code]

  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: Qidget height resize if child widgets invisible

    Do you expect the top level window to reduce its size? If so, you need to set a size constraint on the layout using QLayout::setSizeConstraint(QLayout::SetFixedSize)

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.