Add note about Python bindings in QgsAction

This commit is contained in:
Etienne Trimaille 2020-10-12 09:08:54 +02:00 committed by Nyall Dawson
parent 00ccfc8cea
commit dbe2a3beb6
2 changed files with 17 additions and 4 deletions

View File

@ -42,7 +42,7 @@ Create a new QgsAction
:param description: A human readable description string
:param command: The action text. Its interpretation depends on the type
:param capture: If this is set to ``True``, the output will be captured when an action is run
:param enabledOnlyWhenEditable: if ``True`` then action is only enable in editmode
:param enabledOnlyWhenEditable: if ``True`` then action is only enable in editmode. Not available in Python bindings.
%End
QgsAction( ActionType type, const QString &description, const QString &action, const QString &icon, bool capture, const QString &shortTitle = QString(), const QSet<QString> &actionScopes = QSet<QString>(), const QString &notificationMessage = QString() );
@ -57,7 +57,7 @@ Create a new QgsAction
:param shortTitle: A short string used to label user interface elements like buttons
:param actionScopes: A set of scopes in which this action will be available
:param notificationMessage: A particular message which reception will trigger the action
:param enabledOnlyWhenEditable: if ``True`` then action is only enable in editmode
:param enabledOnlyWhenEditable: if ``True`` then action is only enable in editmode. Not available in Python bindings.
%End
QString name() const;
@ -126,6 +126,12 @@ Whether to capture output for display when this action is run
Returns whether only enabled in editable mode
%End
void setEnabledOnlyWhenEditable( bool enable );
%Docstring
Set whether the action is only enabled in editable mode
.. versionadded:: 3.16
%End
bool runable() const;
%Docstring

View File

@ -57,7 +57,7 @@ class CORE_EXPORT QgsAction
* \param description A human readable description string
* \param command The action text. Its interpretation depends on the type
* \param capture If this is set to TRUE, the output will be captured when an action is run
* \param enabledOnlyWhenEditable if TRUE then action is only enable in editmode
* \param enabledOnlyWhenEditable if TRUE then action is only enable in editmode. Not available in Python bindings.
*/
#ifndef SIP_RUN
QgsAction( ActionType type, const QString &description, const QString &command, bool capture = false, bool enabledOnlyWhenEditable = false )
@ -90,7 +90,7 @@ class CORE_EXPORT QgsAction
* \param shortTitle A short string used to label user interface elements like buttons
* \param actionScopes A set of scopes in which this action will be available
* \param notificationMessage A particular message which reception will trigger the action
* \param enabledOnlyWhenEditable if TRUE then action is only enable in editmode
* \param enabledOnlyWhenEditable if TRUE then action is only enable in editmode. Not available in Python bindings.
*/
#ifndef SIP_RUN
QgsAction( ActionType type, const QString &description, const QString &action, const QString &icon, bool capture, const QString &shortTitle = QString(), const QSet<QString> &actionScopes = QSet<QString>(), const QString &notificationMessage = QString(), bool enabledOnlyWhenEditable = false )
@ -172,6 +172,13 @@ class CORE_EXPORT QgsAction
//! Returns whether only enabled in editable mode
bool isEnabledOnlyWhenEditable() const { return mIsEnabledOnlyWhenEditable; }
/**
* Set whether the action is only enabled in editable mode
*
* \since QGIS 3.16
*/
void setEnabledOnlyWhenEditable( bool enable ) { mIsEnabledOnlyWhenEditable = enable; };
//! Checks if the action is runable on the current platform
bool runable() const;