Skip to content

Commit

Permalink
Use QgsHighlight instead of QgsRubberBand (inner rings of polygons ar…
Browse files Browse the repository at this point in the history
…e shown)
  • Loading branch information
mhugent committed May 21, 2013
1 parent 29871ee commit 1bc397d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 6 additions & 7 deletions src/app/qgsmaptoolidentifyaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "qgsfeature.h"
#include "qgsfield.h"
#include "qgsgeometry.h"
#include "qgshighlight.h"
#include "qgslogger.h"
#include "qgsidentifyresultsdialog.h"
#include "qgsmapcanvas.h"
Expand All @@ -33,7 +34,6 @@
#include "qgsmaplayerregistry.h"
#include "qgisapp.h"
#include "qgsrendererv2.h"
#include "qgsrubberband.h"

#include <QSettings>
#include <QMessageBox>
Expand Down Expand Up @@ -204,11 +204,10 @@ void QgsMapToolIdentifyAction::handleMenuHover()
QList<IdentifyResult>::const_iterator idListIt = idList.constBegin();
for ( ; idListIt != idList.constEnd(); ++idListIt )
{
QgsRubberBand* rb = new QgsRubberBand( mCanvas );
rb->setColor( QColor( 255, 0, 0 ) );
rb->setWidth( 2 );
rb->setToGeometry( idListIt->mFeature.geometry(), vl );
mRubberBands.append( rb );
QgsHighlight* hl = new QgsHighlight( mCanvas, idListIt->mFeature.geometry(), vl );
hl->setColor( QColor( 255, 0, 0 ) );
hl->setWidth( 2 );
mRubberBands.append( hl );
}
}
}
Expand All @@ -217,7 +216,7 @@ void QgsMapToolIdentifyAction::handleMenuHover()

void QgsMapToolIdentifyAction::deleteRubberBands()
{
QList<QgsRubberBand*>::const_iterator it = mRubberBands.constBegin();
QList<QgsHighlight*>::const_iterator it = mRubberBands.constBegin();
for ( ; it != mRubberBands.constEnd(); ++it )
{
delete *it;
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsmaptoolidentifyaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
#include <QObject>
#include <QPointer>

class QgsHighlight;
class QgsIdentifyResultsDialog;
class QgsMapLayer;
class QgsRasterLayer;
class QgsRubberBand;
class QgsVectorLayer;
class QMenu;

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

QgsIdentifyResultsDialog *resultsDialog();

Expand Down

0 comments on commit 1bc397d

Please sign in to comment.