Skip to content
Permalink
Browse files

use forward declaration for QgsFeature

and use as_const on featurelist
  • Loading branch information
signedav committed Oct 25, 2018
1 parent cb19b34 commit fa625ff022786efdb95085a40edcc25d6ba71db4
Showing with 3 additions and 3 deletions.
  1. +2 −2 src/app/qgsmaptoolfeatureaction.cpp
  2. +1 −1 src/app/qgsmaptoolfeatureaction.h
@@ -138,15 +138,15 @@ bool QgsMapToolFeatureAction::doAction( QgsVectorLayer *layer, int x, int y )
else
{
QMenu *featureMenu = new QMenu();
for ( const QgsFeature &feature : features )
for ( const QgsFeature &feature : qgis::as_const( features ) )
{
QAction *featureAction = featureMenu->addAction( FID_TO_STRING( feature.id() ) );
connect( featureAction, &QAction::triggered, this, [ = ] { doActionForFeature( layer, feature, point );} );
}
QAction *allFeatureAction = featureMenu->addAction( tr( "All Features" ) );
connect( allFeatureAction, &QAction::triggered, this, [ = ]
{
for ( const QgsFeature &feature : features )
for ( const QgsFeature &feature : qgis::as_const( features ) )
{
doActionForFeature( layer, feature, point );
}
@@ -18,13 +18,13 @@

#include "qgis.h"
#include "qgsmaptool.h"
#include "qgsfeature.h"

#include <QObject>
#include <QPointer>
#include "qgis_app.h"

class QgsVectorLayer;
class QgsFeature;

/**
\brief Map tool for running feature actions on the current layer

0 comments on commit fa625ff

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