Results 1 to 4 of 4

Thread: Dialog

  1. #1
    Join Date
    Sep 2007
    Posts
    99
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Dialog

    Hi guys...again me...I've desgined a dialog TO which I add/remove widget upon clicking on particular add/remove button (widgets add it to it are added on fly right after I click on add button...they are removed right after I click remove button and widgets have its checkbox checked)...the problem is that the groupbox in which the new widgets are added changes its size only when adding them but when I remove a widget(s) it preserves its size and dont decreases it accordingly...
    Is there a property that has to be set so it would decrease its size when a widget is removed from that groupbox ? it increases its size when the new widget is added...but not decrease accordingly its size when a widgets is/are removed
    Thanks
    I designed that dialog with qtdesigner and the widget that is added to dialogs GroupBox too

    I tried to set the size policy to minimum and so on but it didnt work...

  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: Dialog

    It should work out of the box. There must be something wrong with your code. Did you remember to apply a layout to the dialog?

  3. #3
    Join Date
    Sep 2007
    Posts
    99
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Dialog

    yes I did...I even managed to fix this problem with setting one of the layout's attributes:
    setSizeConstraint(QLayout::SetMinAndMaxSize);
    but you have to set the min and max sizes of your widgets...

  4. #4
    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: Dialog

    You meant the dialog was not shrinking? I thought you meant the groupbox... Yes, the dialog won't shrink by itself without applying a constraint on the top level layout.

Similar Threads

  1. Resizing the dialog boxes
    By anju123 in forum Qt Programming
    Replies: 4
    Last Post: 14th September 2007, 10:41
  2. QGraphicsView: Dialog Position Doubt
    By arjunasd in forum Qt Programming
    Replies: 1
    Last Post: 6th August 2007, 17:48
  3. Replies: 1
    Last Post: 1st February 2007, 17:07
  4. Replies: 3
    Last Post: 23rd July 2006, 18:02
  5. Show/hide part of dialog with resizing.
    By Spockmeat in forum Qt Tools
    Replies: 6
    Last Post: 7th June 2006, 08:22

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.