NDEVR
API Documentation
ButtonGallery.h
1#pragma once
2#include <NDEVR/QCustomScrollArea.h>
3#include <NDEVR/RibbonSubGroup.h>
4#include <NDEVR/TouchScrollManager.h>
5#include <QVBoxLayout>
6namespace NDEVR
7{
12 class NDEVR_WIDGETS_API ButtonGallery : public QCustomScrollArea
13 {
14 public:
19 ButtonGallery(QWidget* parent = nullptr);
24 void setIconSizeMultiplier(fltp04 multiplier);
29 virtual void addButton(Button* button);
33 virtual void sortButtons();
38 virtual void sortButtons(const std::function<bool(Button*, Button*)>& sorter);
43 virtual void removeButton(Button* button);
47 virtual void clear();
52 QSize sizeHint() const override;
62 protected:
64 };
65}
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
void setIconSizeMultiplier(fltp04 multiplier)
Sets the icon size multiplier applied to all buttons in the gallery.
const Buffer< QPointer< Button > > & buttons() const
Returns the list of buttons currently in the gallery.
ButtonGallery(QWidget *parent=nullptr)
Constructs a ButtonGallery with an optional parent widget.
virtual void sortButtons(const std::function< bool(Button *, Button *)> &sorter)
Sorts buttons using a custom comparison function.
virtual void sortButtons()
Sorts buttons alphabetically.
RibbonSubGroup * m_gallery
The internal ribbon sub-group managing the button layout.
void updateGalleryLayout()
Updates the layout of buttons within the gallery after additions or removals.
virtual void clear()
Removes all buttons from the gallery.
QSize sizeHint() const override
Returns the recommended size for the gallery widget.
virtual void addButton(Button *button)
Adds a button to the gallery.
virtual void removeButton(Button *button)
Removes a button from the gallery.
A core widget that allows the user to click one of many button types.
Definition Button.h:68
QCustomScrollArea(QWidget *parent=nullptr)
Constructs a custom scroll area widget.
Represents a sub-section of "Tab" of a ribbon representing a grouping of buttons or widgets within a ...
The primary namespace for the NDEVR SDK.
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...