Skip to content
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

Closed
wants to merge 9 commits into from
Closed

Conversation

ghost
Copy link

@ghost ghost commented Aug 25, 2017

See: #5068

This PR concerns master branch.

@m-kuhn
Copy link
Member

m-kuhn commented Aug 25, 2017

This is really good functionality, but I would say first focus on once branch only (normally master first) until it's in its final state.
What would be great is if you could adjust the commit message to not describe the problem but the change in the commit and add a fix #xyz to it for the audit trail.

Something like

Add click_x and click_y variables for right click triggered actions

Fix #16852

@ghost ghost changed the title #16852: layer actions triggered from identify + right click do not have variables populated (@click_x and others ) Add click_x and click_y variables for right click triggered actions, Fix #16852 Aug 25, 2017
@m-kuhn
Copy link
Member

m-kuhn commented Aug 25, 2017

Thanks, that will help in the future 👍

@m-kuhn
Copy link
Member

m-kuhn commented Aug 28, 2017

This version will need to be adjusted to be implemented without QObject::property

@ghost
Copy link
Author

ghost commented Sep 25, 2017

I have change x & y forwarding with expression context scope.

@haubourg
Copy link
Member

Tested here and it works nicely. Can we move to a merge ? @m-kuhn @pblottiere ?

@@ -150,6 +151,11 @@ class APP_EXPORT QgsIdentifyResultsDialog: public QDialog, private Ui::QgsIdenti
//! Map tool was activated
void activate();

/**
* \brief Set expression context scope.
*/
Copy link
Member

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?

@@ -89,6 +89,15 @@ class CORE_EXPORT QgsActionManager: public QObject
void removeAction( const QUuid &actionId );

/**
* Does the action like doAction() providing
* action context scope.
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some documentation for parameters? Moreover, \since QGIS 3.0 is required in this case.

@@ -0,0 +1,41 @@
/***************************************************************************
qgsactionscope.cpp - QgsActionScope
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

@@ -0,0 +1,73 @@
/***************************************************************************
qgsactionscope.h - QgsActionScope
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

/**
* Creates a new context action.
*
* \since QGIS 3.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering that the whole class is tagged with \since QGIS 3.0, I think that it's not necessary to add another for each underlying methods.

*
* \since QGIS 3.0
*/
QgsContextAction( const QIcon &icon, const QString &text, QObject *parent );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some documentation for parameters?

@@ -91,6 +91,11 @@ class GUI_EXPORT QgsActionMenu : public QMenu
*/
void setFeature( const QgsFeature &feature );

/**
* \brief Set expression context scope.
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\since QGIS 3.0

@@ -146,6 +146,11 @@ class GUI_EXPORT QgsIdentifyMenu : public QMenu
*/
QList<QgsMapToolIdentify::IdentifyResult> exec( const QList<QgsMapToolIdentify::IdentifyResult> &idResults, QPoint pos );

/**
* \brief Set expression context scope.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\since QGIS 3.0

#include <QAction>
#include "qgsexpressioncontext.h"

#define SIP_NO_FILE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this excluded from sip bindings?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants