Results 1 to 2 of 2

Thread: Suggestions for collapsible group boxes?

  1. #1
    Join Date
    Mar 2007
    Posts
    74
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Suggestions for collapsible group boxes?

    Hi,

    I am looking for implementation suggestions on how to implement something
    similar to the attached image.
    I need a way to collapse down the individual 'groupbox' displays contained
    in this form. This implementation was originally done in VB and the small
    << control will collapse or expand the groupbox.

    I originally approached this as dockable windows, but I cannot be tied to
    the qmainwindow area. This set of groupboxes appear on a stacked widget
    page.

    Any suggestions appreciated.
    QT 4.3 on windows..

    Mark
    Attached Images Attached Images

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Suggestions for collapsible group boxes?

    Hint: create a custom widget, especially if you want your collapsible group boxes to look like that.

    It shouldn't be very complex:
    You will have:
    1. The group box widget with a vertical layout( QWidget )

    2. Two widgets contained by the widget at 1).
    2.1. The group box title bar(QWidget with a horizontal layout, containing a horizontal spacer and a custom button. the spacer is needed to push the collapse/expand button to the right )
    2.2. The group box client area -- just a QWidget in which you can add other widgets
    3. The widget from 2.1 should contain the expand/collapse button. When this button is pressed then the widget at 2.2 should be hidden/shown.
    Hiding the widget will cause the vertical layout set to widget 1) to update its size, shrinking to the size of the title bar.
    Showing the widget will have an opposed effect.

    Regards
    Last edited by marcel; 4th August 2007 at 20:42.

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.