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; }
128 QUuid
id()
const {
return mId; }
135 bool isValid()
const {
return !mId.isNull(); }
141 QIcon
icon()
const {
return QIcon( mIcon ); }
163 bool capture()
const {
return mCaptureOutput; }
178 bool runable()
const;
202 QSet<QString> actionScopes()
const;
211 void setActionScopes(
const QSet<QString> &actionScopes );
219 void readXml(
const QDomNode &actionNode );
227 void writeXml( QDomNode &actionsNode )
const;
248 QString html( )
const;
254 void setCommand(
const QString &newCommand );
258 void handleFormSubmitAction(
const QString &expandedAction )
const;
260 QString mDescription;
264 bool mCaptureOutput =
false;
265 QSet<QString> mActionScopes;
266 QString mNotificationMessage;
269 bool mIsEnabledOnlyWhenEditable =
false;
AttributeActionType
Map layer action flags.
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)