56 , mDescription( description )
58 , mCaptureOutput( capture )
59 , mId( QUuid::createUuid() )
60 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
76 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
SIP_PYARGREMOVE =
false )
78 , mDescription( description )
79 , mShortTitle( shortTitle )
82 , mCaptureOutput( capture )
83 , mActionScopes( actionScopes )
84 , mNotificationMessage( notificationMessage )
85 , mId( QUuid::createUuid() )
86 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
103 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
SIP_PYARGREMOVE =
false )
105 , mDescription( description )
106 , mShortTitle( shortTitle )
109 , mCaptureOutput( capture )
110 , mActionScopes( actionScopes )
111 , mNotificationMessage( notificationMessage )
113 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
118 QString
name()
const {
return mDescription; }
127 QUuid
id()
const {
return mId; }
133 bool isValid()
const {
return !mId.isNull(); }
139 QIcon
icon()
const {
return QIcon( mIcon ); }
159 bool capture()
const {
return mCaptureOutput; }
174 bool runable()
const;
195 QSet<QString> actionScopes()
const;
203 void setActionScopes(
const QSet<QString> &actionScopes );
210 void readXml(
const QDomNode &actionNode );
217 void writeXml( QDomNode &actionsNode )
const;
236 QString html( )
const;
242 void setCommand(
const QString &newCommand );
246 void handleFormSubmitAction(
const QString &expandedAction )
const;
248 QString mDescription;
252 bool mCaptureOutput =
false;
253 QSet<QString> mActionScopes;
254 QString mNotificationMessage;
257 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.
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.
QgsAction()=default
Default constructor.
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...
Represents a vector layer which manages a vector based data sets.
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)