-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add click_x and click_y variables for right click triggered actions, Fix #16852 #5071
Changes from all commits
f381cc5
6ee11c2
95ece74
52bd152
0520da5
f9347ed
c4ace9a
b313310
33dbe74
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,15 @@ class CORE_EXPORT QgsActionManager: public QObject | |
*/ | ||
void removeAction( const QUuid &actionId ); | ||
|
||
/** | ||
* Does the action like doAction() providing | ||
* action context scope. | ||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add some documentation for parameters? Moreover, |
||
void doActionWithContext( const QUuid &actionId, | ||
const QgsFeature &feat, | ||
QgsExpressionContextScope *actionScope, | ||
int defaultValueIndex = 0 ); | ||
|
||
/** | ||
* Does the given action. defaultValueIndex is the index of the | ||
* field to be used if the action has a $currfield placeholder. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/*************************************************************************** | ||
qgsactionscope.cpp - QgsActionScope | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo |
||
|
||
--------------------- | ||
begin : 25.09.2017 | ||
copyright : (C) 2017 by C. MARCEL | ||
email : clement.marcel@nwanda.fr | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
#include "qgscontextaction.h" | ||
|
||
QgsContextAction::QgsContextAction( QObject *parent ): | ||
QAction( parent ) | ||
{ | ||
} | ||
|
||
QgsContextAction::QgsContextAction( const QString &text, QObject *parent ): | ||
QAction( text, parent ) | ||
{ | ||
} | ||
|
||
QgsContextAction::QgsContextAction( const QIcon &icon, const QString &text, QObject *parent ): | ||
QAction( icon, text, parent ) | ||
{ | ||
} | ||
|
||
QgsExpressionContextScope QgsContextAction::expressionContextScope() const | ||
{ | ||
return mExpressionContextScope; | ||
} | ||
|
||
void QgsContextAction::setExpressionContextScope( const QgsExpressionContextScope &expressionContextScope ) | ||
{ | ||
mExpressionContextScope = expressionContextScope; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/*************************************************************************** | ||
qgsactionscope.h - QgsActionScope | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo |
||
|
||
--------------------- | ||
begin : 25.09.2017 | ||
copyright : (C) 2017 by C. MARCEL | ||
email : clement.marcel@nwanda.fr | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
#ifndef QGSCONTEXTACTION_H | ||
#define QGSCONTEXTACTION_H | ||
|
||
#include "qgis_core.h" | ||
#include <QString> | ||
#include <QAction> | ||
#include "qgsexpressioncontext.h" | ||
|
||
#define SIP_NO_FILE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this excluded from sip bindings? |
||
|
||
/** | ||
* \ingroup core | ||
* QgsContextAction is derived from QAction and contains a context expression scope. | ||
* | ||
* \since QGIS 3.0 | ||
*/ | ||
class CORE_EXPORT QgsContextAction: public QAction | ||
{ | ||
public: | ||
|
||
/** | ||
* Creates a new context action. | ||
* | ||
* \since QGIS 3.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Considering that the whole class is tagged with |
||
*/ | ||
explicit QgsContextAction( QObject *parent ); | ||
|
||
/** | ||
* Creates a new context action providing action text. | ||
* | ||
* \since QGIS 3.0 | ||
*/ | ||
QgsContextAction( const QString &text, QObject *parent ); | ||
|
||
/** | ||
* Creates a new context action providing action text & icon. | ||
* | ||
* \since QGIS 3.0 | ||
*/ | ||
QgsContextAction( const QIcon &icon, const QString &text, QObject *parent ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add some documentation for parameters? |
||
|
||
/** | ||
* Action context scope. | ||
* | ||
* \since QGIS 3.0 | ||
*/ | ||
QgsExpressionContextScope expressionContextScope() const; | ||
|
||
/** | ||
* \copydoc expressionContextScope() | ||
*/ | ||
void setExpressionContextScope( const QgsExpressionContextScope &expressionContextScope ); | ||
|
||
private: | ||
QgsExpressionContextScope mExpressionContextScope; | ||
}; | ||
|
||
#endif // QGSCONTEXTACTION_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,6 +91,11 @@ class GUI_EXPORT QgsActionMenu : public QMenu | |
*/ | ||
void setFeature( const QgsFeature &feature ); | ||
|
||
/** | ||
* \brief Set expression context scope. | ||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
void setExpressionContextScope( const QgsExpressionContextScope &expressionContextScope ); | ||
|
||
signals: | ||
void reinit(); | ||
|
||
|
@@ -107,6 +112,9 @@ class GUI_EXPORT QgsActionMenu : public QMenu | |
QgsFeature mFeature; | ||
QgsFeatureId mFeatureId; | ||
QString mActionScope; | ||
|
||
// expression context scope. | ||
QgsExpressionContextScope mExpressionContextScope; | ||
}; | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add
\since QGIS 3.0
?