Skip to content

Commit 127b656

Browse files
author
wonder
committed
changed std::map to QMap in QgsRasterLayer::identify(), updated PyQGIS
git-svn-id: http://svn.osgeo.org/qgis/trunk@8443 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 070879c commit 127b656

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

python/core/qgsrasterlayer.sip

+1-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ public:
7878
*
7979
* \param point[in] a coordinate in the CRS of this layer.
8080
*/
81-
// TODO: wrap
82-
//void identify(const QgsPoint & point, std::map<QString,QString>& results);
81+
void identify(const QgsPoint & point, QMap<QString,QString>& results /Out/);
8382

8483
/** \brief Identify arbitrary details from the WMS server found on the point position
8584
*

src/app/qgsmaptoolidentify.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ void QgsMapToolIdentify::identifyRasterLayer(QgsRasterLayer* layer, const QgsPoi
131131
if (!layer)
132132
return;
133133

134-
std::map<QString, QString> attributes;
134+
QMap<QString, QString> attributes;
135135
layer->identify(point, attributes);
136136

137137
if(!mResults)
@@ -152,10 +152,10 @@ void QgsMapToolIdentify::identifyRasterLayer(QgsRasterLayer* layer, const QgsPoi
152152
mResults->setTitle( layer->name() );
153153
mResults->setColumnText ( 0, QObject::tr("Band") );
154154

155-
std::map<QString, QString>::iterator it;
155+
QMap<QString, QString>::iterator it;
156156
for (it = attributes.begin(); it != attributes.end(); it++)
157157
{
158-
mResults->addAttribute(it->first, it->second);
158+
mResults->addAttribute(it.key(), it.value());
159159
}
160160

161161
mResults->addAttribute( tr("(clicked coordinate)"), point.stringRep() );

src/core/raster/qgsrasterlayer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4804,7 +4804,7 @@ bool QgsRasterLayer::readXML_( QDomNode & layer_node )
48044804

48054805

48064806

4807-
void QgsRasterLayer::identify(const QgsPoint& point, std::map<QString,QString>& results)
4807+
void QgsRasterLayer::identify(const QgsPoint& point, QMap<QString,QString>& results)
48084808
{
48094809
double x = point.x();
48104810
double y = point.y();

src/core/raster/qgsrasterlayer.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
#include <QDateTime>
129129
#include <QVector>
130130
#include <QList>
131+
#include <QMap>
131132

132133
#include "qgis.h"
133134
#include "qgspoint.h"
@@ -247,7 +248,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
247248
*
248249
* \param point[in] a coordinate in the CRS of this layer.
249250
*/
250-
void identify(const QgsPoint & point, std::map<QString,QString>& results);
251+
void identify(const QgsPoint & point, QMap<QString,QString>& results);
251252

252253
/** \brief Identify arbitrary details from the WMS server found on the point position
253254
*

0 commit comments

Comments
 (0)