Class SBGAction#
#include <SBGAction.hpp>
Inherits the following classes: QAction
Public Slots#
Type | Name |
---|---|
slot void | onTriggerEvent (bool b) Slot called when the action is triggered. |
Public Signals#
Type | Name |
---|---|
signal void | actionEnd (bool) |
signal void | actionStart (bool) |
signal void | donePercent (int) |
signal void | doneText (const QString &) |
signal void | favorited (bool) The action has been added to favorites or removed from favorites. |
Public Functions#
Type | Name |
---|---|
SBGAction (QObject * parent, bool isDiscoverable=true) |
|
SBGAction (const SBUUID & uuid=SBUUID(), QObject * parent=nullptr, bool isDiscoverable=true) |
|
SBGAction (const QString & text, const SBUUID & uuid=SBUUID(), QObject * parent=nullptr, bool isDiscoverable=true) |
|
SBGAction (const QIcon & icon, const QString & text, const SBUUID & uuid=SBUUID(), QObject * parent=nullptr, bool isDiscoverable=true) |
|
SB_DECLARE_DATA (SBGAction) |
|
bool | getAddableToFavoritesFlag () const Returns true if the action can be added to favorites. By default, the flag is true. |
unsigned int | getBadge () const Returns the badge. |
QColor | getBadgeBackgroundColor () const Returns the badge background color. |
QColor | getBadgeTextColor () const Returns the badge text color. |
virtual QString | getDescriptionImagePath () const Returns a path to an image which will be placed into the action's description. If not specified, the action's icon might be used instead. |
bool | getFavoriteFlag () const Returns the favorite flag. |
SBNode * | getHighlightedNode () const Returns the highlighted node. |
bool | getHighlightingFlag () const Returns the highlighting flag. |
virtual QString | getName () const Returns the action's class name. |
virtual SBUUID | getUUID () const Returns the action's UUID. |
bool | hasFavoriteFlag () const Returns true if the action has the favorite flag, i.e. whether it complies with criteria that make it possible to add it to favorites. |
virtual bool | isDiscoverable () const Returns true if can be discovered by the user. |
virtual bool | isLocked () const Returns true if the action is locked. |
void | refresh () Refresh all widgets containing the action. |
virtual void | run (const SBNodeIndexer & nodeIndexer) Runs the action on nodes in the nodeIndexer . |
void | setAddableToFavoritesFlag (bool b) Sets whether the action can be added to favorites. It also connects/disconnect the 'favorited' signal. By default, all actions are addable to favorites (once they've been registered). Change the "addableToFavorites" flag in workspace XML to modify this parameter. |
void | setBadge (unsigned int badge) Sets the badge. |
void | setBadgeBackgroundColor (const QColor & badgeBackgroundColor) Sets the badge background color. |
void | setBadgeTextColor (const QColor & badgeTextColor) Sets the badge text color. |
void | setFavoriteFlag (bool favoriteFlag) Sets the favorite flag. |
void | setHighlightedNode (SBNode * highlightedNode) Sets the highlighted node. |
void | setHighlightingFlag (bool highlightingFlag) Sets the highlighting flag. |
void | setIconFilename (const QString & filename="SAMSON.png") Define icon filename, icon file should be in current skin icon path. |
void | setIconPathname (const QString & filename) Define icon pathname, icon file can have an arbitrary path. |
void | setIconPixmap (const QPixmap & pixmap) Define icon based on a given pixmap. |
virtual | ~SBGAction () |
Public Static Functions#
Type | Name |
---|---|
QIcon | makeIcon (const QString & filename) Make an icon, with both a normal and disabled version, from a filename that includes the absolute path to an image. |
QIcon | makeIcon (const QPixmap & normalPixmap) Make an icon, with both a normal and disabled version, from a normal pixmap. |
Protected Attributes#
Type | Name |
---|---|
SBGActionData * | dataPointer |
Protected Functions#
Type | Name |
---|---|
bool | event (QEvent * e) override |
Detailed Description#
This class is the base class for actions
Short name: SBAction
Public Slots Documentation#
slot onTriggerEvent#
Slot called when the action is triggered.
Public Signals Documentation#
signal actionEnd#
signal actionStart#
signal donePercent#
signal doneText#
signal favorited#
The action has been added to favorites or removed from favorites.
Public Functions Documentation#
function SBGAction [1/4]#
function SBGAction [2/4]#
SBGAction::SBGAction (
const SBUUID & uuid=SBUUID (),
QObject * parent=nullptr,
bool isDiscoverable=true
)
function SBGAction [3/4]#
SBGAction::SBGAction (
const QString & text,
const SBUUID & uuid=SBUUID (),
QObject * parent=nullptr,
bool isDiscoverable=true
)
function SBGAction [4/4]#
SBGAction::SBGAction (
const QIcon & icon,
const QString & text,
const SBUUID & uuid=SBUUID (),
QObject * parent=nullptr,
bool isDiscoverable=true
)
function SB_DECLARE_DATA#
function getAddableToFavoritesFlag#
Returns true if the action can be added to favorites. By default, the flag is true.
function getBadge#
Returns the badge.
function getBadgeBackgroundColor#
Returns the badge background color.
function getBadgeTextColor#
Returns the badge text color.
function getDescriptionImagePath#
Returns a path to an image which will be placed into the action's description. If not specified, the action's icon might be used instead.
function getFavoriteFlag#
Returns the favorite flag.
function getHighlightedNode#
Returns the highlighted node.
function getHighlightingFlag#
Returns the highlighting flag.
function getName#
Returns the action's class name.
function getUUID#
Returns the action's UUID.
function hasFavoriteFlag#
Returns true if the action has the favorite flag, i.e. whether it complies with criteria that make it possible to add it to favorites.
function isDiscoverable#
Returns true if can be discovered by the user.
function isLocked#
Returns true if the action is locked.
function refresh#
Refresh all widgets containing the action.
function run#
Runs the action on nodes in the nodeIndexer
.
This is a specialized function that runs this action on nodes in the nodeIndexer
.
By default, when an action is triggered (via the SBGAction::trigger function or by triggering it via UI) it is applied to the whole document or to the current selection depending on the action's implementation. If you want to make it possible to apply an action to nodes in a node indexer without the need to first select such nodes, then you need to implement this function.
Parameters:
nodeIndexer
An indexer of nodes to which the action should be applied
function setAddableToFavoritesFlag#
Sets whether the action can be added to favorites. It also connects/disconnect the 'favorited' signal. By default, all actions are addable to favorites (once they've been registered). Change the "addableToFavorites" flag in workspace XML to modify this parameter.
function setBadge#
Sets the badge.
function setBadgeBackgroundColor#
Sets the badge background color.
function setBadgeTextColor#
Sets the badge text color.
function setFavoriteFlag#
Sets the favorite flag.
function setHighlightedNode#
Sets the highlighted node.
function setHighlightingFlag#
Sets the highlighting flag.
function setIconFilename#
Define icon filename, icon file should be in current skin icon path.
function setIconPathname#
Define icon pathname, icon file can have an arbitrary path.
function setIconPixmap#
Define icon based on a given pixmap.
function ~SBGAction#
Public Static Functions Documentation#
function makeIcon [1/2]#
Make an icon, with both a normal and disabled version, from a filename that includes the absolute path to an image.
function makeIcon [2/2]#
Make an icon, with both a normal and disabled version, from a normal pixmap.