A custom widget that implements a slide-in/slide-out sidebar with animation. More...
#include <SideBarWidget.h>
Public Types | |
enum class | Role { SideBar , MainSide , SideBar , MainSide , SideBar , MainSide } |
Defines which layout role to apply widgets to. | |
enum class | Role { SideBar , MainSide , SideBar , MainSide , SideBar , MainSide } |
Defines which layout role to apply widgets to. | |
enum class | Role { SideBar , MainSide , SideBar , MainSide , SideBar , MainSide } |
Defines which layout role to apply widgets to. | |
Public Member Functions | |
SideBarWidget (QWidget *parent=nullptr) | |
Constructor to initialize the sidebar widget. | |
~SideBarWidget () | |
Destructor to release resources. | |
void | showSideBar () |
Shows the sidebar using animation. | |
void | hideSideBar () |
Hides the sidebar using animation. | |
void | addLayout (const QWidgetList &widgetList, Role r) |
Adds widgets to either the sidebar or the main side layout. | |
void | removeLayout (Role r) |
Removes all widgets from the specified layout role. | |
void | setAnimationDuration (int duration) |
Sets the animation duration. | |
void | setAnimationCurve (QEasingCurve::Type curve) |
Sets the easing curve type for the animation. | |
bool | current_ui_states () |
Returns the current state of sidebar visibility. | |
SideBarWidget (QWidget *parent=nullptr) | |
Constructor to initialize the sidebar widget. | |
~SideBarWidget () | |
Destructor to release resources. | |
void | showSideBar () |
Shows the sidebar using animation. | |
void | hideSideBar () |
Hides the sidebar using animation. | |
void | addLayout (const QWidgetList &widgetList, Role r) |
Adds widgets to either the sidebar or the main side layout. | |
void | removeLayout (Role r) |
Removes all widgets from the specified layout role. | |
void | setAnimationDuration (int duration) |
Sets the animation duration. | |
void | setAnimationCurve (QEasingCurve::Type curve) |
Sets the easing curve type for the animation. | |
bool | current_ui_states () |
Returns the current state of sidebar visibility. | |
SideBarWidget (QWidget *parent=nullptr) | |
Constructor to initialize the sidebar widget. | |
~SideBarWidget () | |
Destructor to release resources. | |
void | showSideBar () |
Shows the sidebar using animation. | |
void | hideSideBar () |
Hides the sidebar using animation. | |
void | addLayout (const QWidgetList &widgetList, Role r) |
Adds widgets to either the sidebar or the main side layout. | |
void | removeLayout (Role r) |
Removes all widgets from the specified layout role. | |
void | setButtonVisible (bool visible) |
Sets the visibility of the control button. | |
void | setAnimationDuration (int duration) |
Sets the animation duration. | |
void | setAnimationCurve (QEasingCurve::Type curve) |
Sets the easing curve type for the animation. | |
bool | current_ui_states () |
Returns the current state of sidebar visibility. | |
Protected Member Functions | |
void | resizeEvent (QResizeEvent *) |
resizeEvent | |
void | resizeEvent (QResizeEvent *) |
resizeEvent | |
A custom widget that implements a slide-in/slide-out sidebar with animation.
|
explicit |
Constructor to initialize the sidebar widget.
parent | Optional parent widget. |
|
explicit |
Constructor to initialize the sidebar widget.
parent | Optional parent widget. |
|
explicit |
Constructor to initialize the sidebar widget.
parent | Optional parent widget. |
void SideBarWidget::addLayout | ( | const QWidgetList & | widgetList, |
Role | r | ||
) |
Adds widgets to either the sidebar or the main side layout.
widgetList | The list of widgets to add. |
r | The role indicating target layout. |
void SideBarWidget::addLayout | ( | const QWidgetList & | widgetList, |
Role | r | ||
) |
Adds widgets to either the sidebar or the main side layout.
widgetList | The list of widgets to add. |
r | The role indicating target layout. |
void SideBarWidget::addLayout | ( | const QWidgetList & | widgetList, |
Role | r | ||
) |
Adds widgets to either the sidebar or the main side layout.
widgetList | The list of widgets to add. |
r | The role indicating target layout. |
|
inline |
Returns the current state of sidebar visibility.
|
inline |
Returns the current state of sidebar visibility.
|
inline |
Returns the current state of sidebar visibility.
void SideBarWidget::removeLayout | ( | Role | r | ) |
Removes all widgets from the specified layout role.
r | The role indicating which layout to clear. |
void SideBarWidget::removeLayout | ( | Role | r | ) |
Removes all widgets from the specified layout role.
r | The role indicating which layout to clear. |
void SideBarWidget::removeLayout | ( | Role | r | ) |
Removes all widgets from the specified layout role.
r | The role indicating which layout to clear. |
void SideBarWidget::setAnimationCurve | ( | QEasingCurve::Type | curve | ) |
Sets the easing curve type for the animation.
curve | The easing curve to use. |
void SideBarWidget::setAnimationCurve | ( | QEasingCurve::Type | curve | ) |
Sets the easing curve type for the animation.
curve | The easing curve to use. |
void SideBarWidget::setAnimationCurve | ( | QEasingCurve::Type | curve | ) |
Sets the easing curve type for the animation.
curve | The easing curve to use. |
void SideBarWidget::setAnimationDuration | ( | int | duration | ) |
Sets the animation duration.
duration | Duration in milliseconds. |
void SideBarWidget::setAnimationDuration | ( | int | duration | ) |
Sets the animation duration.
duration | Duration in milliseconds. |
void SideBarWidget::setAnimationDuration | ( | int | duration | ) |
Sets the animation duration.
duration | Duration in milliseconds. |
void SideBarWidget::setButtonVisible | ( | bool | visible | ) |
Sets the visibility of the control button.
visible | Whether the button should be visible. |