53 , mDescription( description )
56 , mId( QUuid::createUuid() )
57 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
75 const QString &description,
76 const QString &action,
85 , mDescription( description )
92 , mId( QUuid::createUuid() )
93 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
113 const QString &description,
114 const QString &action,
123 , mDescription( description )
131 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
136 QString
name()
const {
return mDescription; }
145 QUuid
id()
const {
return mId; }
151 bool isValid()
const {
return !mId.isNull(); }
157 QIcon
icon()
const {
return QIcon( mIcon ); }
177 bool capture()
const {
return mCaptureOutput; }
192 bool runable()
const;
213 QSet<QString> actionScopes()
const;
221 void setActionScopes(
const QSet<QString> &actionScopes );
236 void writeXml( QDomNode &actionsNode )
const;
255 QString html()
const;
261 void setCommand(
const QString &newCommand );
264 void handleFormSubmitAction(
const QString &expandedAction )
const;
266 QString mDescription;
270 bool mCaptureOutput =
false;
271 QSet<QString> mActionScopes;
272 QString mNotificationMessage;
275 bool mIsEnabledOnlyWhenEditable =
false;
AttributeActionType
Attribute action types.
Utility class that encapsulates an action based on vector attributes.
void setEnabledOnlyWhenEditable(bool enable)
Set whether the action is only enabled in editable mode.
QString notificationMessage() const
Returns the notification message that triggers the action.
QString name() const
The name of the action. This may be a longer description.
QSet< QString > actionScopes() const
The action scopes define where an action will be available.
Qgis::AttributeActionType type() const
The action type.
QgsAction(const QUuid &id, Qgis::AttributeActionType type, const QString &description, const QString &action, const QString &icon, bool capture, const QString &shortTitle=QString(), const QSet< QString > &actionScopes=QSet< QString >(), const QString ¬ificationMessage=QString(), bool enabledOnlyWhenEditable=false)
Create a new QgsAction.
QIcon icon() const
The icon.
QString iconPath() const
The path to the icon.
bool isValid() const
Returns true if this action was a default constructed one.
QgsAction(Qgis::AttributeActionType type, const QString &description, const QString &command, bool capture=false, bool enabledOnlyWhenEditable=false)
Create a new QgsAction.
QString command() const
Returns the command that is executed by this action.
QgsAction(Qgis::AttributeActionType type, const QString &description, const QString &action, const QString &icon, bool capture, const QString &shortTitle=QString(), const QSet< QString > &actionScopes=QSet< QString >(), const QString ¬ificationMessage=QString(), bool enabledOnlyWhenEditable=false)
Create a new QgsAction.
QString shortTitle() const
The short title is used to label user interface elements like buttons.
bool isEnabledOnlyWhenEditable() const
Returns whether only enabled in editable mode.
bool capture() const
Whether to capture output for display when this action is run.
QUuid id() const
Returns a unique id for this action.
Single scope for storing variables and functions for use within a QgsExpressionContext.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
A container for the context for various read/write operations on objects.
Represents a vector layer which manages a vector based dataset.
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)