QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
qgsrasteridentifyresult.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsrasteridentifyresult.h
3 --------------------------------------
4 Date : Apr 8, 2013
5 Copyright : (C) 2013 by Radim Blazek
6 email : radim dot blazek at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSRASTERIDENTIFYRESULT_H
19#define QGSRASTERIDENTIFYRESULT_H
20
21#include "qgis_core.h"
22#include "qgis_sip.h"
23#include "qgsraster.h"
24#include "qgserror.h"
25
30class CORE_EXPORT QgsRasterIdentifyResult
31{
32 public:
33
35
41 QgsRasterIdentifyResult( Qgis::RasterIdentifyFormat format, const QMap<int, QVariant> &results );
42
47 QgsRasterIdentifyResult( const QgsError &error );
48
49 virtual ~QgsRasterIdentifyResult() = default;
50
52 bool isValid() const { return mValid; }
53
55 Qgis::RasterIdentifyFormat format() const { return mFormat; }
56
64 QMap<int, QVariant> results() const { return mResults; }
65
67 void setParams( const QMap<QString, QVariant> &params ) { mParams = params; }
68
70 QMap<QString, QVariant> params() const { return mParams; }
71
73 QgsError error() const { return mError; }
74
76 void setError( const QgsError &error ) { mError = error;}
77
78 private:
80 bool mValid = false;
81
84
85 // TODO: better hierarchy (sublayer multiple feature sets)?
86 // TODO?: results are not consistent for different formats (per band x per sublayer)
87
89 QMap<int, QVariant> mResults;
90
92 QMap<QString, QVariant> mParams;
93
95 QgsError mError;
96};
97
98#endif
99
100
RasterIdentifyFormat
Raster identify formats.
Definition qgis.h:4496
A container for error messages.
Definition qgserror.h:81
Raster identify results container.
QMap< QString, QVariant > params() const
Gets map of optional parameters.
void setError(const QgsError &error)
Sets the last error.
void setParams(const QMap< QString, QVariant > &params)
Sets map of optional parameters.
QgsError error() const
Returns the last error.
bool isValid() const
Returns true if valid.
QMap< int, QVariant > results() const
Returns the identify results.
Qgis::RasterIdentifyFormat format() const
Returns the results format.
virtual ~QgsRasterIdentifyResult()=default
QgsRasterIdentifyResult()=default