A scrollable gallery widget that displays a collection of Buttons in a flow layout.
More...
|
| | ButtonGallery (QWidget *parent=nullptr) |
| | Constructs a ButtonGallery with an optional parent widget.
|
| virtual void | addButton (Button *button) |
| | Adds a button to the gallery.
|
| const Buffer< QPointer< Button > > & | buttons () const |
| | Returns the list of buttons currently in the gallery.
|
|
virtual void | clear () |
| | Removes all buttons from the gallery.
|
| virtual void | removeButton (Button *button) |
| | Removes a button from the gallery.
|
| void | setIconSizeMultiplier (fltp04 multiplier) |
| | Sets the icon size multiplier applied to all buttons in the gallery.
|
| QSize | sizeHint () const override |
| | Returns the recommended size for the gallery widget.
|
| virtual void | sortButtons () |
| | Sorts buttons alphabetically.
|
| virtual void | sortButtons (const std::function< bool(Button *, Button *)> &sorter) |
| | Sorts buttons using a custom comparison function.
|
|
void | updateGalleryLayout () |
| | Updates the layout of buttons within the gallery after additions or removals.
|
| | QCustomScrollArea (QWidget *parent=nullptr) |
| | Constructs a custom scroll area widget.
|
| bool | eventFilter (QObject *, QEvent *event) override |
| | Filters events for the child widget to handle resize and layout updates.
|
| void | setUseFullScroll (bool use_full_scroll) |
| | Sets whether the scroll area uses full scroll mode, where the scroll area expands to accommodate the full content size in the size hint.
|
| void | setWidget (QWidget *w) |
| | Sets the scrollable child widget.
|
| QSize | sizeHint () const override |
| | Returns the recommended size for the scroll area.
|
| QWidget * | takeWidget () |
| | Removes and returns the scrollable child widget without deleting it.
|
| bool | useFullScroll () const |
| | Returns whether full scroll mode is enabled.
|
|
|
RibbonSubGroup * | m_gallery |
| | The internal ribbon sub-group managing the button layout.
|
|
bool | m_use_full_scroll = false |
| | Whether the scroll area uses full scroll mode.
|
A scrollable gallery widget that displays a collection of Buttons in a flow layout.
Definition at line 12 of file ButtonGallery.h.
◆ ButtonGallery()
| ButtonGallery::ButtonGallery |
( |
QWidget * | parent = nullptr | ) |
|
Constructs a ButtonGallery with an optional parent widget.
- Parameters
-
| [in] | parent | The parent widget. |
◆ addButton()
| virtual void ButtonGallery::addButton |
( |
Button * | button | ) |
|
|
virtual |
Adds a button to the gallery.
- Parameters
-
| [in] | button | The button to add. |
◆ buttons()
| const Buffer< QPointer< Button > > & ButtonGallery::buttons |
( |
| ) |
const |
Returns the list of buttons currently in the gallery.
- Returns
- A const reference to the buffer of button pointers.
◆ removeButton()
| virtual void ButtonGallery::removeButton |
( |
Button * | button | ) |
|
|
virtual |
Removes a button from the gallery.
- Parameters
-
| [in] | button | The button to remove. |
◆ setIconSizeMultiplier()
| void ButtonGallery::setIconSizeMultiplier |
( |
fltp04 | multiplier | ) |
|
Sets the icon size multiplier applied to all buttons in the gallery.
- Parameters
-
| [in] | multiplier | The icon size multiplier (1.0 = default). |
◆ sizeHint()
| QSize ButtonGallery::sizeHint |
( |
| ) |
const |
|
override |
Returns the recommended size for the gallery widget.
- Returns
- The preferred size hint.
◆ sortButtons() [1/2]
| virtual void ButtonGallery::sortButtons |
( |
| ) |
|
|
virtual |
Sorts buttons alphabetically.
◆ sortButtons() [2/2]
| virtual void ButtonGallery::sortButtons |
( |
const std::function< bool(Button *, Button *)> & | sorter | ) |
|
|
virtual |
Sorts buttons using a custom comparison function.
- Parameters
-
| [in] | sorter | The comparison function returning true if the first button should precede the second. |
The documentation for this class was generated from the following file: