Vertically stacked collapsible-panel (accordion) widget.
More...
#include <accordionwidget.h>
|
|
virtual void | onPreferencesChanged () |
| | Called when application preferences change; reapplies styling.
|
| |
|
|
void | itemCountModified () |
| | Emitted when a panel is added or removed.
|
| |
|
| | AccordionWidget (QWidget *parent=nullptr) |
| | Construct with an optional parent widget.
|
| |
| void | addItem (const QString &title, QWidget *content) |
| | Append a new panel at the end.
|
| |
| void | insertItem (int index, const QString &title, QWidget *content) |
| | Insert a new panel at a specific position.
|
| |
| void | removeItem (int index) |
| | Remove the panel at the given index.
|
| |
| void | setItemVisible (int index, bool visible) |
| | Show or hide the panel at the given index.
|
| |
|
void | clear () |
| | Remove all panels from the widget.
|
| |
|
void | expandAll () |
| | Expand all panels.
|
| |
|
void | collapseAll () |
| | Collapse all panels.
|
| |
| void | setExpanded (QWidget *widget, bool expanded) |
| | Expand or collapse the panel containing the given content widget.
|
| |
| bool | isExpanded (QWidget *widget) const |
| | Return whether the panel containing the given content widget is expanded.
|
| |
| bool | areAllExpanded () const |
| | Return whether all panels are currently expanded.
|
| |
| bool | areAllCollapsed () const |
| | Return whether all panels are currently collapsed.
|
| |
| void | setTitle (QWidget *widget, const QString &title) |
| | Change the title of the panel containing the given content widget.
|
| |
| int | indexOf (QWidget *widget) const |
| | Return the index of the panel containing the given content widget.
|
| |
| int | count () const |
| | Return the number of panels.
|
| |
Vertically stacked collapsible-panel (accordion) widget.
AccordionWidget manages a list of AccordionItem panels, each with a title button and a content widget. Items can be added, removed, expanded, and collapsed individually or all at once.
Definition at line 17 of file accordionwidget.h.
◆ AccordionWidget()
| AccordionWidget::AccordionWidget |
( |
QWidget * |
parent = nullptr | ) |
|
|
explicit |
Construct with an optional parent widget.
- Parameters
-
| parent | Optional QWidget parent |
◆ addItem()
| void AccordionWidget::addItem |
( |
const QString & |
title, |
|
|
QWidget * |
content |
|
) |
| |
Append a new panel at the end.
- Parameters
-
| title | Title shown on the panel's header button |
| content | Widget displayed when the panel is expanded |
◆ areAllCollapsed()
| bool AccordionWidget::areAllCollapsed |
( |
| ) |
const |
Return whether all panels are currently collapsed.
- Returns
- true if every panel is collapsed
◆ areAllExpanded()
| bool AccordionWidget::areAllExpanded |
( |
| ) |
const |
Return whether all panels are currently expanded.
- Returns
- true if every panel is expanded
◆ count()
| int AccordionWidget::count |
( |
| ) |
const |
Return the number of panels.
- Returns
- Panel count
◆ indexOf()
| int AccordionWidget::indexOf |
( |
QWidget * |
widget | ) |
const |
Return the index of the panel containing the given content widget.
- Parameters
-
| widget | Content widget to look up |
- Returns
- Zero-based index, or -1 if not found
◆ insertItem()
| void AccordionWidget::insertItem |
( |
int |
index, |
|
|
const QString & |
title, |
|
|
QWidget * |
content |
|
) |
| |
Insert a new panel at a specific position.
- Parameters
-
| index | Zero-based position to insert at |
| title | Title shown on the panel's header button |
| content | Widget displayed when the panel is expanded |
◆ isExpanded()
| bool AccordionWidget::isExpanded |
( |
QWidget * |
widget | ) |
const |
Return whether the panel containing the given content widget is expanded.
- Parameters
-
| widget | Content widget identifying the panel |
- Returns
- true if the panel is expanded
◆ removeItem()
| void AccordionWidget::removeItem |
( |
int |
index | ) |
|
Remove the panel at the given index.
- Parameters
-
| index | Zero-based index of the panel to remove |
◆ setExpanded()
| void AccordionWidget::setExpanded |
( |
QWidget * |
widget, |
|
|
bool |
expanded |
|
) |
| |
Expand or collapse the panel containing the given content widget.
- Parameters
-
| widget | Content widget identifying the panel |
| expanded | true to expand, false to collapse |
◆ setItemVisible()
| void AccordionWidget::setItemVisible |
( |
int |
index, |
|
|
bool |
visible |
|
) |
| |
Show or hide the panel at the given index.
- Parameters
-
| index | Zero-based index of the panel |
| visible | true to show, false to hide |
◆ setTitle()
| void AccordionWidget::setTitle |
( |
QWidget * |
widget, |
|
|
const QString & |
title |
|
) |
| |
Change the title of the panel containing the given content widget.
- Parameters
-
| widget | Content widget identifying the panel |
| title | New title text |
The documentation for this class was generated from the following file: