Skip to content

Commit 55a8d41

Browse files
committedFeb 23, 2018
document parameters
1 parent 1875d4a commit 55a8d41

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎src/core/qgsaction.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class CORE_EXPORT QgsAction
5757
* \param description A human readable description string
5858
* \param command The action text. Its interpretation depends on the type
5959
* \param capture If this is set to true, the output will be captured when an action is run
60+
* \param enabledOnlyWhenEditable if true then action is only enable in editmode
6061
*/
6162
QgsAction( ActionType type, const QString &description, const QString &command, bool capture = false, bool enabledOnlyWhenEditable = false )
6263
: mType( type )
@@ -78,6 +79,7 @@ class CORE_EXPORT QgsAction
7879
* \param shortTitle A short string used to label user interface elements like buttons
7980
* \param actionScopes A set of scopes in which this action will be available
8081
* \param notificationMessage A particular message which reception will trigger the action
82+
* \param enabledOnlyWhenEditable if true then action is only enable in editmode
8183
*/
8284
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 )
8385
: mType( type )

6 commit comments

Comments
 (6)

nyalldawson commented on Feb 23, 2018

@nyalldawson
Collaborator

@signedav looking really close - please don't forget to replace the bool enabledOnlyWhenEditable argument with a more flexible flags approach!

signedav commented on Feb 23, 2018

@signedav
ContributorAuthor

I'll need some more time for the flag approach. Is the total deadline for that reached in 3 minutes or should I do it this afternoon?

nyalldawson commented on Feb 23, 2018

@nyalldawson
Collaborator

Can you skip this bool from the python bindings then, so it's not locked into api and we can revise for 3.2?

signedav commented on Feb 23, 2018

@signedav
ContributorAuthor

I'm not familiar with the binding, sorry.
Is this the right approach?

    QgsAction( ActionType type, const QString &description, const QString &command, bool capture = false, bool enabledOnlyWhenEditable SIP_PYARGREMOVE = false )

And is it sufficient to do it only in the constructors of QgsAction and QgsMapLayerAction or is it needed in every method?

nyalldawson commented on Feb 23, 2018

@nyalldawson
Collaborator

In this case you'd do something like

#ifndef SIP_RUN
...original declaration
#else
...declaration missing extra Param
#endif

Then run sipify and the python bindings should be missing the extra argument. I'd just do it for all the constructors with the bool argument.

signedav commented on Feb 23, 2018

@signedav
ContributorAuthor

Ok. I'll try that. Thanks.

Please sign in to comment.