Loading...
Searching...
No Matches
SBGAction Class Reference

This class is the base class for actions.

Action

SBGActionData * dataPointer
 
virtual void onTriggerEvent (bool b)
 Slot called when the action is triggered.
 
void actionStart (bool)
 
void actionEnd (bool)
 
void donePercent (int)
 
void doneText (const QString &)
 
void favorited (bool)
 The action has been added to favorites or removed from favorites.
 

Constructors and destructor

 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)
 
virtual ~SBGAction ()
 

Identity

virtual QString getName () const
 Returns the action's class name.
 
virtual SBUUID getUUID () const
 Returns the action's UUID.
 
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.
 
static 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.
 
static QIcon makeIcon (const QPixmap &normalPixmap)
 Make an icon, with both a normal and disabled version, from a normal pixmap.
 

User interface

virtual bool isLocked () const
 Returns true if the action is locked.
 
virtual bool isDiscoverable () const
 Returns true if can be discovered by the user.
 
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.
 

Highlighting

void refresh ()
 Refresh all widgets containing the action.
 
bool getHighlightingFlag () const
 Returns the highlighting flag.
 
void setHighlightingFlag (bool highlightingFlag)
 Sets the highlighting flag.
 

Badge

unsigned int getBadge () const
 Returns the badge.
 
void setBadge (unsigned int badge)
 Sets the badge.
 
QColor getBadgeTextColor () const
 Returns the badge text color.
 
void setBadgeTextColor (const QColor &badgeTextColor)
 Sets the badge text color.
 
QColor getBadgeBackgroundColor () const
 Returns the badge background color.
 
void setBadgeBackgroundColor (const QColor &badgeBackgroundColor)
 Sets the badge background color.
 

Favorite

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.
 
bool getFavoriteFlag () const
 Returns the favorite flag.
 
void setFavoriteFlag (bool favoriteFlag)
 Sets the favorite flag.
 
bool getAddableToFavoritesFlag () const
 Returns true if the action can be added to favorites. By default, the flag is true.
 
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.
 

Setup

SBNodegetHighlightedNode () const
 Returns the highlighted node.
 
void setHighlightedNode (SBNode *highlightedNode)
 Sets the highlighted node.
 
 SB_DECLARE_DATA (SBGAction)
 
bool event (QEvent *) override