![]() |
ImFusion SDK 4.3
|
#include <ImFusion/GUI/SectionWidget.h>
The SectionWidget provides a way to group widgets in vertical sections. More...
Inheritance diagram for SectionWidget:The SectionWidget provides a way to group widgets in vertical sections.
Each section has a title and is separated from the previous section Every second section has a lighter background color for improved contrast.
Since this is a custom widget, it is not available in QtDesigner UI files. Instead you can create one QWidget container for each section in the UI file and create the SectionWidget in the C++ code. The containter widgets can then be moved to the SectionWidget with addSection():
Replacing the layout of a SectionWidget with QWidget::setLayout is not supported!
Public Slots | |
| void | setWorkflowMode (bool workflowMode) |
| Enables/Disables the workflow mode. | |
Public Member Functions | |
| SectionWidget (QWidget *parent=nullptr) | |
| int | addSection (const QString &title, QWidget *widget, bool checkable=false) |
| Appends a new section with the given 'title' that contains the given 'widget'. | |
| int | count () const |
| Returns the number of sections. | |
| QWidget * | section (int index) const |
| Returns the section widget at the given index or 0 if no such index exists. | |
| void | setSectionChecked (int index, bool checked) |
| Sets the checked state of the section with the given index. | |
| void | setSectionVisible (int index, bool visible) |
| Hide/Show specified section. | |
| bool | sectionChecked (int index) const |
| Returns true if the section with the given index is checked. | |
| void | setSectionVisibility (int index, bool visible) |
| Set the visibility of the section with the given index. | |
| bool | workflowMode () const |
| Returns if the SectionWidget is in workflow mode. | |
Properties | |
| bool | workflowMode |
| int addSection | ( | const QString & | title, |
| QWidget * | widget, | ||
| bool | checkable = false ) |
Appends a new section with the given 'title' that contains the given 'widget'.
When calling with a QWidget that is already part of a layout, the widget will be automatically removed from the previous layout. The section can be optionally 'checkable', in which case a checkbox is added next to the title that hides or shows the widget if unchecked/checked. Only sections with a non-empty title can be checkable. Returns the index of the section.
| void setSectionChecked | ( | int | index, |
| bool | checked ) |
Sets the checked state of the section with the given index.
Does nothing if the section is not checkable (see addSection)
| bool sectionChecked | ( | int | index | ) | const |
Returns true if the section with the given index is checked.
Returns false otherwise or if the section is not checkable.
|
slot |
Enables/Disables the workflow mode.
In workflow mode, the separators between sections indicate a workflow from top to bottom.