![]() |
NDEVR
API Documentation
|
Represents the "Tab" of a widget. More...
Public Member Functions | |
| RibbonGroup (QWidget *parent=nullptr) | |
| Constructs a ribbon group widget. | |
| RibbonSubGroup * | addSubGroup (const TranslatedString &sub_group_name) |
| Adds a new sub-group with the given name. | |
| void | addSubGroup (QWidget *sub_group) |
| Adds an existing widget as a sub-group. | |
| void | adjustButtonsToFit (int primary, int secondary) |
| Adjusts button sizes and states to fit within the given dimensions. | |
| void | cleanupEmpty () |
| Removes any empty sub-groups. | |
| int | currentPrimaryDimension () const |
| Returns the current size along the primary layout axis (width or height). | |
| int | currentSecondaryDimension () const |
| Returns the current size along the secondary layout axis. | |
| bool | hasSubGroup (const TranslatedString &sub_group) const |
| Checks whether a sub-group with the given name exists. | |
| bool | isEmpty () const |
| Returns whether this ribbon group has no sub-groups or all are empty. | |
| int | largeButtonWidth () const |
| Returns the width of a large button in the current layout. | |
| void | layoutSubGroups () |
| Slot that performs the layout of all sub-groups within this ribbon group. | |
| int | marginThickness () const |
| Returns the margin thickness around the ribbon group content. | |
| uint04 | maxNumOfColumns () const |
| Returns the maximum number of columns across all sub-groups. | |
| int | mediumButtonWidth () const |
| Returns the width of a medium button in the current layout. | |
| QSize | minimumSizeHint () const override |
| Returns the minimum recommended size for this ribbon group. | |
| Vector< 2, int > | minSize () const |
| Returns the minimum size as a 2D vector (primary, secondary). | |
| RibbonSubGroup & | operator[] (const TranslatedString &location) |
| Returns the sub-group with the given name, creating it if it does not exist. | |
| RibbonSubGroup * | removeSubGroup (const String &sub_group) |
| Removes the sub-group with the given string key. | |
| void | removeSubGroup (const TranslatedString &sub_group) |
| Removes the sub-group with the given translated name. | |
| void | resetButtonStates () |
| Resets all button states in all sub-groups to their defaults. | |
| void | ribbonResizeEvent (int primary, int secondary) |
| Notifies the group of a ribbon resize, triggering sub-group relayout. | |
| void | setFixedNumOfRows (uint01 fixed_num_of_rows) |
| Sets a fixed number of rows for the layout. | |
| void | setNumberOfRows (uint04 number_of_rows) |
| Sets the number of rows used for laying out buttons. | |
| void | setupSeparator (QFrame *seperator) const |
| Configures a separator frame for visual separation between sub-groups. | |
| void | setVertical (bool is_vertical) |
| Sets whether the ribbon group layout is vertical. | |
| void | updateLayout (QSize size) |
| Updates the internal layout to fit the given size. | |
Public Attributes | |
| uint01 | m_fixed_num_of_rows |
| Fixed number of rows, or 0 for automatic. | |
| bool | m_is_vertical |
| Whether the layout is vertical. | |
| int | m_last_width |
| The last known width, used to detect resize changes. | |
| QBoxLayout * | m_layout |
| The box layout managing sub-group arrangement. | |
| RibbonLayoutMode | m_layout_mode |
| The current layout mode. | |
| uint04 | m_row_num |
| Current number of layout rows. | |
| Buffer< QFrame * > | m_separators |
| Visual separators between sub-groups. | |
| Dictionary< String, RibbonSubGroup * > | m_sub_group_lookup |
| Sub-groups indexed by name. | |
| Buffer< QWidget * > | m_sub_groups |
| Ordered list of sub-group widgets. | |
Represents the "Tab" of a widget.
For example sections such as Home, View, Edit, Measurements would all be RibbonGroups and children of a Ribbon object.
Definition at line 51 of file RibbonGroup.h.
| RibbonGroup::RibbonGroup | ( | QWidget * | parent = nullptr | ) |
Constructs a ribbon group widget.
| [in] | parent | Optional parent widget. |
| RibbonSubGroup * RibbonGroup::addSubGroup | ( | const TranslatedString & | sub_group_name | ) |
Adds a new sub-group with the given name.
| [in] | sub_group_name | The translated name of the sub-group. |
| void RibbonGroup::addSubGroup | ( | QWidget * | sub_group | ) |
Adds an existing widget as a sub-group.
| [in] | sub_group | The widget to add as a sub-group. |
| void RibbonGroup::adjustButtonsToFit | ( | int | primary, |
| int | secondary ) |
Adjusts button sizes and states to fit within the given dimensions.
| [in] | primary | The available primary dimension in pixels. |
| [in] | secondary | The available secondary dimension in pixels. |
| int RibbonGroup::currentPrimaryDimension | ( | ) | const |
Returns the current size along the primary layout axis (width or height).
| int RibbonGroup::currentSecondaryDimension | ( | ) | const |
Returns the current size along the secondary layout axis.
| bool RibbonGroup::hasSubGroup | ( | const TranslatedString & | sub_group | ) | const |
Checks whether a sub-group with the given name exists.
| [in] | sub_group | The translated name to look up. |
| bool RibbonGroup::isEmpty | ( | ) | const |
Returns whether this ribbon group has no sub-groups or all are empty.
| int RibbonGroup::largeButtonWidth | ( | ) | const |
Returns the width of a large button in the current layout.
| int RibbonGroup::marginThickness | ( | ) | const |
Returns the margin thickness around the ribbon group content.
| uint04 RibbonGroup::maxNumOfColumns | ( | ) | const |
Returns the maximum number of columns across all sub-groups.
| int RibbonGroup::mediumButtonWidth | ( | ) | const |
Returns the width of a medium button in the current layout.
|
override |
Returns the minimum recommended size for this ribbon group.
| Vector< 2, int > RibbonGroup::minSize | ( | ) | const |
Returns the minimum size as a 2D vector (primary, secondary).
| RibbonSubGroup & RibbonGroup::operator[] | ( | const TranslatedString & | location | ) |
Returns the sub-group with the given name, creating it if it does not exist.
| [in] | location | The translated sub-group name. |
| RibbonSubGroup * RibbonGroup::removeSubGroup | ( | const String & | sub_group | ) |
Removes the sub-group with the given string key.
| [in] | sub_group | The string key of the sub-group to remove. |
| void RibbonGroup::removeSubGroup | ( | const TranslatedString & | sub_group | ) |
Removes the sub-group with the given translated name.
| [in] | sub_group | The translated name of the sub-group to remove. |
| void RibbonGroup::ribbonResizeEvent | ( | int | primary, |
| int | secondary ) |
Notifies the group of a ribbon resize, triggering sub-group relayout.
| [in] | primary | The available primary dimension in pixels. |
| [in] | secondary | The available secondary dimension in pixels. |
| void RibbonGroup::setFixedNumOfRows | ( | uint01 | fixed_num_of_rows | ) |
Sets a fixed number of rows for the layout.
| [in] | fixed_num_of_rows | The number of rows, or 0 for automatic. |
| void RibbonGroup::setNumberOfRows | ( | uint04 | number_of_rows | ) |
Sets the number of rows used for laying out buttons.
| [in] | number_of_rows | The number of rows. |
| void RibbonGroup::setupSeparator | ( | QFrame * | seperator | ) | const |
Configures a separator frame for visual separation between sub-groups.
| [in] | seperator | The QFrame to configure as a separator. |
| void RibbonGroup::setVertical | ( | bool | is_vertical | ) |
Sets whether the ribbon group layout is vertical.
| [in] | is_vertical | True for vertical orientation. |
| void RibbonGroup::updateLayout | ( | QSize | size | ) |
Updates the internal layout to fit the given size.
| [in] | size | The available size. |