Skip to content

Commit 1bc397d

Browse files
committed
Use QgsHighlight instead of QgsRubberBand (inner rings of polygons are shown)
1 parent 29871ee commit 1bc397d

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/app/qgsmaptoolidentifyaction.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "qgsfeature.h"
2020
#include "qgsfield.h"
2121
#include "qgsgeometry.h"
22+
#include "qgshighlight.h"
2223
#include "qgslogger.h"
2324
#include "qgsidentifyresultsdialog.h"
2425
#include "qgsmapcanvas.h"
@@ -33,7 +34,6 @@
3334
#include "qgsmaplayerregistry.h"
3435
#include "qgisapp.h"
3536
#include "qgsrendererv2.h"
36-
#include "qgsrubberband.h"
3737

3838
#include <QSettings>
3939
#include <QMessageBox>
@@ -204,11 +204,10 @@ void QgsMapToolIdentifyAction::handleMenuHover()
204204
QList<IdentifyResult>::const_iterator idListIt = idList.constBegin();
205205
for ( ; idListIt != idList.constEnd(); ++idListIt )
206206
{
207-
QgsRubberBand* rb = new QgsRubberBand( mCanvas );
208-
rb->setColor( QColor( 255, 0, 0 ) );
209-
rb->setWidth( 2 );
210-
rb->setToGeometry( idListIt->mFeature.geometry(), vl );
211-
mRubberBands.append( rb );
207+
QgsHighlight* hl = new QgsHighlight( mCanvas, idListIt->mFeature.geometry(), vl );
208+
hl->setColor( QColor( 255, 0, 0 ) );
209+
hl->setWidth( 2 );
210+
mRubberBands.append( hl );
212211
}
213212
}
214213
}
@@ -217,7 +216,7 @@ void QgsMapToolIdentifyAction::handleMenuHover()
217216

218217
void QgsMapToolIdentifyAction::deleteRubberBands()
219218
{
220-
QList<QgsRubberBand*>::const_iterator it = mRubberBands.constBegin();
219+
QList<QgsHighlight*>::const_iterator it = mRubberBands.constBegin();
221220
for ( ; it != mRubberBands.constEnd(); ++it )
222221
{
223222
delete *it;

src/app/qgsmaptoolidentifyaction.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
#include <QObject>
2828
#include <QPointer>
2929

30+
class QgsHighlight;
3031
class QgsIdentifyResultsDialog;
3132
class QgsMapLayer;
3233
class QgsRasterLayer;
33-
class QgsRubberBand;
3434
class QgsVectorLayer;
3535
class QMenu;
3636

@@ -80,7 +80,7 @@ class QgsMapToolIdentifyAction : public QgsMapToolIdentify
8080
//! layer id map for layer select mode
8181
QMap< QgsMapLayer*, QList<IdentifyResult> > mLayerIdResults;
8282
//! rubber bands for layer select mode
83-
QList<QgsRubberBand*> mRubberBands;
83+
QList<QgsHighlight*> mRubberBands;
8484

8585
QgsIdentifyResultsDialog *resultsDialog();
8686

0 commit comments

Comments
 (0)