StatusBarAction
Qualified name: mv::gui::StatusBarAction
-
class StatusBarAction : public mv::gui::WidgetAction
Status bar action class.
Base status bar action class with popup functionality
There are two methods to add content to the status bar popup:
By setting a popup action: setPopupAction(…)
By adding menu actions: addMenuAction(…)
The index controls the location w.r.t. the other status bar items:
When negative, the item is inserted in between existing items(right-to-left)
Wen zero, the item is appended to the existing items at the right
Wen positive, the item is inserted in between existing items(left-to-right)
- Author
Thomas Kroes
Subclassed by mv::gui::PluginStatusBarAction
Public Functions
-
StatusBarAction(QObject *parent, const QString &title, const util::StyledIcon &icon = util::StyledIcon())
Construct with
parentobject,titleand possibly anicon.- Parameters:
parent – Pointer to parent object
title – Title of the action
icon – Icon
-
StatusBarAction(QObject *parent, const QString &title, const QString &icon = "")
Construct with
parentobject,titleand possibly a FontAwesomeicon.- Parameters:
parent – Pointer to parent object
title – Title of the action
icon – FontAwesome icon name
-
~StatusBarAction() override
Destructor for removing this action from StatusBarAction::statusBarActions.
-
HorizontalGroupAction &getBarGroupAction()
Get bar group action.
- Returns:
Reference to bar group action
-
StringAction &getBarIconStringAction()
Get bar icon string action.
- Returns:
Reference to bar icon string action
-
WidgetAction *getPopupAction()
Get popup action.
- Returns:
Pointer to popup action (maybe nullptr)
-
void setPopupAction(WidgetAction *popupAction)
Set popup action to
popupAction.- Parameters:
popupAction – Pointer to popup action
-
void addMenuAction(WidgetAction *menuAction)
Add
menuAction.- Parameters:
menuAction – Pointer to menu action
-
void removeMenuAction(WidgetAction *menuAction)
Remove
menuAction.- Parameters:
menuAction – Pointer to menu action to remove
-
WidgetActions getMenuActions()
Get menu actions.
- Returns:
Pointers to menu actions
-
std::int32_t getIndex()
Get index (must be called prior to main window showing, otherwise it will not have an effect)
- Returns:
Position index
-
void setIndex(std::int32_t index)
Set index to
index.- Parameters:
index – Position index
-
void popupActionChanged(WidgetAction *previousPopupAction, WidgetAction *popupAction)
Signals that the popup action changed from
previousPopupActiontopopupAction.- Parameters:
previousPopupAction – Pointer to previous action (maybe nullptr)
popupAction – Pointer to current action (maybe nullptr)
-
void indexChanged(std::int32_t index)
Signals that the position
indexchanged.- Parameters:
index – Position index
Signals that
menuActionwas added.- Parameters:
menuAction – Pointer to menu action that was added
Signals that
menuActionis about to be removed.- Parameters:
menuAction – Pointer to menu action is about to be removed
-
void requirePopupShow()
Signals that a popup should be displayed.
-
void requirePopupHide()
Signals that a popup should be hidden.
Public Static Functions
-
static WidgetActions getStatusBarActions()
Get registered status bar action.
- Returns:
Status bar actions
Protected Functions
-
virtual QWidget *getWidget(QWidget *parent, const std::int32_t &widgetFlags) override
Get widget representation of the status bar action.
- Parameters:
parent – Pointer to parent widget
widgetFlags – Widget flags for the configuration of the widget
-
void showPopup()
Show the popup.
-
void hidePopup()
Hide the popup.
-
class Widget : public mv::gui::WidgetActionWidget
Widget class for display of a status bar action.
Protected Functions
-
Widget(QWidget *parent, StatusBarAction *statusBarAction, const std::int32_t &widgetFlags)
Constructor.
- Parameters:
parent – Pointer to parent widget
statusBarAction – Pointer to owning status bar action
widgetFlags – Widget flags for the configuration of the widget
Protected Attributes
-
ToolButton _toolButton
Pointer to owning status bar action.
-
QWidget *_popupWidget
Customized tool button.
Friends
- friend class StatusBarAction
-
Widget(QWidget *parent, StatusBarAction *statusBarAction, const std::int32_t &widgetFlags)