[Qgis-developer] Upgraded collapsible groupboxes

Larry Shaffer larrys at dakotacarto.com
Tue Sep 11 11:15:15 PDT 2012


Hi,

Over the past couple of days Etienne Tourigny and I have upgraded the
functionality of the QgsCollapsibleGroupBox class he recently
introduced. The changes have been pushed to master branch and can be
seen in the Save As... dialog for raster layers and in the scroll
areas of the 3 tabs in the PAL Labeling options.

We have tested on some Linux versions and on Mac. *Feedback on the
look and functionality, as well as any OS-specific issues, would be
greatly appreciated.* It would be best to make sure these new changes
work on (hopefully) every supported platform before using them more
extensively.

New features:

* Disclosure triangle collapses/expands independent of groupbox title checkbox.
* Title checkbox also intuitively collapses/expands the groupbox.
* Groupbox title can be clicked to collapse/expand groupbox,
regardless of whether it has a checkbox.
* Collapsed/expanded state is auto-saved/loaded to QSettings,
persisting between dialog openings and relaunch.

Using the custom class in QtDesigner:

* Just promote existing or new groupbox widgets using
QgsCollapsibleGroupBox.h. (Note: there will be no visual or functional
change with the promoted groupbox, either in form layout or preview
modes)
* Work with groupboxes as normal in Designer; it will have collapsible
features when shown in QGIS.
* Default state is expanded.
* Use mMyGroupBox->setCollapsed( true ); to set preferred collapsed
state before first showing. This is always override-able by user
later, but will help devs craft the initial look they want in the
dialog (e.g. hide advanced or secondary settings).
* Please give your groupboxes appropriate names, like
mScaleVisibilityGroupBox, instead of leaving it vague, like
groupBox_3. That name and the object name of the parent window is what
is saved in QSettings for persisting state.


I think these changes will greatly reduce scrolling and clutter as
dialogs become more complex.

Thanks to Etienne Tourigny for introducing the feature and his work on
making it better.

Regards,

Larry Shaffer


More information about the Qgis-developer mailing list