Showing with 32 additions and 11 deletions.
  1. +5 −4 i18n/qgis_it.ts
  2. +6 −3 src/app/qgsidentifyresultsdialog.cpp
  3. +17 −3 src/gui/qgshighlight.cpp
  4. +4 −1 src/gui/qgshighlight.h
9 changes: 5 additions & 4 deletions i18n/qgis_it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13443,7 +13443,7 @@ Secondo me si (rospus ;-)</translatorcomment>
<location filename="../src/app/qgisapp.cpp" line="4916"/>
<location filename="../src/app/qgisapp.cpp" line="4997"/>
<source>Composer %1</source>
<translation>Layout %1</translation>
<translation>Modello %1</translation>
</message>
<message>
<location filename="../src/app/qgisapp.cpp" line="4959"/>
Expand Down Expand Up @@ -13648,7 +13648,8 @@ Errori: %2
<message>
<location filename="../src/app/qgisapp.cpp" line="2144"/>
<source>Layers</source>
<translation>Layer</translation>
<translatorcomment>Prima era &quot;Layer&quot;, inappropriato</translatorcomment>
<translation>Legenda</translation>
</message>
<message>
<location filename="../src/app/qgisapp.cpp" line="4744"/>
Expand Down Expand Up @@ -16290,7 +16291,7 @@ Should the existing classes be deleted before classification?</source>
<message>
<location filename="../src/app/composer/qgscomposer.cpp" line="227"/>
<source>Layout</source>
<translation>Layout</translation>
<translation>Modello</translation>
</message>
<message>
<location filename="../src/app/composer/qgscomposer.cpp" line="254"/>
Expand Down Expand Up @@ -24634,7 +24635,7 @@ p, li { white-space: pre-wrap; }
<message>
<location filename="../src/ui/qgsfieldspropertiesbase.ui" line="77"/>
<source>Attribute editor layout:</source>
<translation>Layout dell&apos;editor degli attributi:</translation>
<translation>Modello dell&apos;editor degli attributi:</translation>
</message>
<message>
<location filename="../src/ui/qgsfieldspropertiesbase.ui" line="17"/>
Expand Down
9 changes: 6 additions & 3 deletions src/app/qgsidentifyresultsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1143,10 +1143,13 @@ void QgsIdentifyResultsDialog::attributeValueChanged( QgsFeatureId fid, int idx,

void QgsIdentifyResultsDialog::highlightFeature( QTreeWidgetItem *item )
{
QgsVectorLayer *layer = vectorLayer( item );
QgsMapLayer *layer;
QgsVectorLayer *vlayer = vectorLayer( item );
QgsRasterLayer *rlayer = rasterLayer( item );
if ( !layer && !rlayer )
return;

layer = vlayer ? static_cast<QgsMapLayer *>( vlayer ) : static_cast<QgsMapLayer *>( rlayer );

if ( !layer ) return;

QgsIdentifyResultsFeatureItem *featItem = dynamic_cast<QgsIdentifyResultsFeatureItem *>( featureItem( item ) );
if ( !featItem )
Expand Down
20 changes: 17 additions & 3 deletions src/gui/qgshighlight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "qgshighlight.h"
#include "qgsgeometry.h"
#include "qgsmapcanvas.h"
#include "qgsmaplayer.h"
#include "qgsmaprenderer.h"
#include "qgscoordinatetransform.h"
#include "qgsvectorlayer.h"
Expand All @@ -25,14 +26,27 @@
\brief The QgsHighlight class provides a transparent overlay widget
for highlightng features on the map.
*/
QgsHighlight::QgsHighlight( QgsMapCanvas* mapCanvas, QgsGeometry *geom, QgsVectorLayer *layer )
QgsHighlight::QgsHighlight( QgsMapCanvas* mapCanvas, QgsGeometry *geom, QgsMapLayer *layer )
: QgsMapCanvasItem( mapCanvas )
, mLayer( layer )
{
mGeometry = geom ? new QgsGeometry( *geom ) : 0;
if ( mapCanvas->mapRenderer()->hasCrsTransformEnabled() )
init();
}

QgsHighlight::QgsHighlight( QgsMapCanvas* mapCanvas, QgsGeometry *geom, QgsVectorLayer *layer )
: QgsMapCanvasItem( mapCanvas )
, mLayer( static_cast<QgsMapLayer *>( layer ) )
{
mGeometry = geom ? new QgsGeometry( *geom ) : 0;
init();
}

void QgsHighlight::init()
{
if ( mMapCanvas->mapRenderer()->hasCrsTransformEnabled() )
{
QgsCoordinateTransform transform( mLayer->crs(), mapCanvas->mapRenderer()->destinationCrs() );
QgsCoordinateTransform transform( mLayer->crs(), mMapCanvas->mapRenderer()->destinationCrs() );
mGeometry->transform( transform );
}
updateRect();
Expand Down
5 changes: 4 additions & 1 deletion src/gui/qgshighlight.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@
#include <QPainter>
#include <QPainterPath>

class QgsMapLayer;
class QgsVectorLayer;

/** A class for highlight features on the map.
*/
class GUI_EXPORT QgsHighlight: public QgsMapCanvasItem
{
public:
QgsHighlight( QgsMapCanvas *mapCanvas, QgsGeometry *geom, QgsMapLayer *layer );
QgsHighlight( QgsMapCanvas *mapCanvas, QgsGeometry *geom, QgsVectorLayer *layer );
~QgsHighlight();

Expand All @@ -43,6 +45,7 @@ class GUI_EXPORT QgsHighlight: public QgsMapCanvasItem
void updateRect();

private:
void init();
void paintPoint( QPainter *p, QgsPoint point );
void paintLine( QPainter *p, QgsPolyline line );
void paintPolygon( QPainter *p, QgsPolygon polygon );
Expand All @@ -52,7 +55,7 @@ class GUI_EXPORT QgsHighlight: public QgsMapCanvasItem
QBrush mBrush;
QPen mPen;
QgsGeometry *mGeometry;
QgsVectorLayer *mLayer;
QgsMapLayer *mLayer;
};

#endif