Class sh::actions::SubmenuActionItem¶
-
class
sh::actions
::
SubmenuActionItem
: public sh::actions::AbstractActionItem¶ Abstract base class for a submenu.
It can be made visible in menus or the toolbar or executed directly.
Subclasses fill the submenu with other actions in order to be useful.
Subclassed by sh::actions::common::ActionAbstractTransferTo, sh::actions::common::ActionBookmarkFolder, sh::actions::common::ActionGroups, sh::actions::common::ActionHistoryNavigate, sh::actions::common::ActionOpenFileWith, sh::actions::common::ActionOpenTerminal, sh::actions::mainmenu::ActionApplyProfile, sh::actions::mainmenu::ActionMain, sh::actions::mainmenu::ActionNumberFileviews, sh::scripting::api::ApiSubmenuActionItem
Public Functions
-
SubmenuActionItem
(QString text, const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems = {}, bool enabled = true, QString icon = QString(), int defaultActionPrecedence = 0, bool checkable = false, bool ischecked = false)¶ Is (for subclasses) intended to be directly constructed from everywhere or by registering a factory somewhere.
-
const QList<std::shared_ptr<sh::actions::AbstractActionItem>>
subitems
()¶ Returns the list of subitems from this submenu.
-
void
setSubitems
(const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems)¶ Sets the subitems.
-
QString
text
()¶ Returns the displayed text for this action.
-
QString
icon
()¶ Returns the icon for this action.
-
bool
enabled
()¶ Checks if this action is enabled.
-
bool
isChecked
()¶ Checks if this action is checked (has a cross in the ui).
-
bool
isCheckable
()¶ Checks if this action is checkable (can have a cross in the ui).
-
int
defaultActionPrecedence
() const¶ Returns the precedence for becoming the default action of a parent submenu.
This e.g. leads to a bold label.
The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.
-
void
setText
(QString text)¶ Sets the displayed text.
-
void
setIcon
(QString icon)¶ Sets the icon.
-
void
setEnabled
(bool enabled)¶ Sets if the item is enabled.
-
void
setChecked
(bool checked)¶ Sets if the item is checked (has a cross in the ui).
-
void
setVisible
(bool visible)¶ Sets the visibility of this item.
-
bool
visible
()¶ Checks the visibility of this item (non-recursively).
-
std::weak_ptr<AbstractActionItem>
parentAction
()¶ Returns the parent action, if it is added to a container.
-
void
_setParentAction
(std::shared_ptr<AbstractActionItem> parent)¶ Sets the parent action. .
-
void
initializeAsync
(std::function<void()> oninitialized = 0)¶ Asynchonously initializes the action.
-
void
initializeSync
()¶ Synchonously initializes the action.
-
bool
isInitialized
()¶ Checks if this action is initialized.
-
bool
isInitializing
()¶ Checks if this action is initializing.
Signals
-
void
subitemsChanged
()¶ Emits when the list of subitems changed.
-
void
changed
()¶ Emits when some data changed.
Private Members
-
QList<std::shared_ptr<sh::actions::AbstractActionItem>>
_subitems
¶
-