Skip to content
Permalink
Browse files

document parameters

  • Loading branch information
signedav committed Feb 23, 2018
1 parent 1875d4a commit 55a8d41cdf6da3b6b4131da8b67e37216fa3f98f
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/core/qgsaction.h
@@ -57,6 +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
*/
QgsAction( ActionType type, const QString &description, const QString &command, bool capture = false, bool enabledOnlyWhenEditable = false )
: mType( type )
@@ -78,6 +79,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
*/
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 )
: mType( type )

6 comments on commit 55a8d41

@nyalldawson

This comment has been minimized.

Copy link
Collaborator

@nyalldawson nyalldawson replied Feb 23, 2018

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

@signedav

This comment has been minimized.

Copy link
Contributor Author

@signedav signedav replied Feb 23, 2018

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

This comment has been minimized.

Copy link
Collaborator

@nyalldawson nyalldawson replied Feb 23, 2018

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

This comment has been minimized.

Copy link
Contributor Author

@signedav signedav replied Feb 23, 2018

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

This comment has been minimized.

Copy link
Collaborator

@nyalldawson nyalldawson replied Feb 23, 2018

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

This comment has been minimized.

Copy link
Contributor Author

@signedav signedav replied Feb 23, 2018

Ok. I'll try that. Thanks.

Please sign in to comment.
You can’t perform that action at this time.