A widget that represents a section with a collapsible content area.
More...
#include <section.h>
|
| | SectionWidget (QWidget *parent=nullptr) |
| | Constructs a new SectionWidget.
|
| void | addItem (QWidget *container, const QString &title) |
| | Adds an item to the section with a title.
|
| void | addItem (QWidget *container, const QString &title, oclero::qlementine::TextRole role) |
| | Adds an item to the section with a title and text role.
|
| void | setExpanded (bool expanded) |
| | Sets whether the section is expanded or collapsed.
|
| bool | isExpanded () const |
| | Returns whether the section is currently expanded.
|
| void | setDuration (int duration) |
| | Sets the duration of the animation for expanding and collapsing.
|
| QWidget * | content () const |
| | Returns the content widget of the section.
|
| void | updateContentHeight (int height) |
| | Updates the height of the content area.
|
|
| int | getAnimationDuration (int target, int current) const |
| | Pointer to the property animation.
|
| void | toggled (bool checked) |
| | Slot called when the toggle button is toggled.
|
|
|
QWidget * | mContent = nullptr |
| | Pointer to the toggle button for expanding/collapsing.
|
|
CollapsibleAreaHeight * | mContentArea = nullptr |
| | Pointer to the content widget.
|
|
bool | mExpanded = true |
| | Pointer to the collapsible area.
|
|
std::optional< int > | mDuration = std::nullopt |
| | Current state of the section (expanded or collapsed).
|
|
QPropertyAnimation * | mAnimation = nullptr |
| | Duration of the animation for expanding and collapsing.
|
A widget that represents a section with a collapsible content area.
◆ SectionWidget()
| SectionWidget::SectionWidget |
( |
QWidget * | parent = nullptr | ) |
|
◆ addItem() [1/2]
| void SectionWidget::addItem |
( |
QWidget * | container, |
|
|
const QString & | title ) |
Adds an item to the section with a title.
- Parameters
-
| container | The widget to add as content. |
| title | The title of the item. |
◆ addItem() [2/2]
| void SectionWidget::addItem |
( |
QWidget * | container, |
|
|
const QString & | title, |
|
|
oclero::qlementine::TextRole | role ) |
Adds an item to the section with a title and text role.
- Parameters
-
| container | The widget to add as content. |
| title | The title of the item. |
| role | The text role for the title. |
◆ content()
| QWidget * SectionWidget::content |
( |
| ) |
const |
Returns the content widget of the section.
- Returns
- The content widget.
◆ getAnimationDuration()
| int SectionWidget::getAnimationDuration |
( |
int | target, |
|
|
int | current ) const |
|
inlineprivate |
Pointer to the property animation.
Calculates the duration of the animation based on target and current heights.
- Parameters
-
| target | The target height. |
| current | The current height. |
- Returns
- The calculated duration in milliseconds.
◆ isExpanded()
| bool SectionWidget::isExpanded |
( |
| ) |
const |
Returns whether the section is currently expanded.
- Returns
- True if expanded, false otherwise.
◆ setDuration()
| void SectionWidget::setDuration |
( |
int | duration | ) |
|
Sets the duration of the animation for expanding and collapsing.
- Parameters
-
| duration | The duration in milliseconds. |
◆ setExpanded()
| void SectionWidget::setExpanded |
( |
bool | expanded | ) |
|
Sets whether the section is expanded or collapsed.
- Parameters
-
| expanded | True to expand, false to collapse. |
◆ toggled()
| void SectionWidget::toggled |
( |
bool | checked | ) |
|
|
private |
Slot called when the toggle button is toggled.
- Parameters
-
| checked | True if the button is checked (expanded), false otherwise. |
◆ updateContentHeight()
| void SectionWidget::updateContentHeight |
( |
int | height | ) |
|
Updates the height of the content area.
- Parameters
-
| height | The new height in pixels. |
The documentation for this class was generated from the following files:
- /__w/maki/maki/app/widgets/section.h
- /__w/maki/maki/app/widgets/section.cpp