mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
Const correctness for QgsGeometry::Error
This commit is contained in:
parent
a6e0e39bcd
commit
8ba442f14a
@ -1481,9 +1481,10 @@ by calling `error()` on the returned geometry.
|
|||||||
explicit Error( const QString &m );
|
explicit Error( const QString &m );
|
||||||
|
|
||||||
Error( const QString &m, const QgsPointXY &p );
|
Error( const QString &m, const QgsPointXY &p );
|
||||||
QString what();
|
QString what() const;
|
||||||
QgsPointXY where();
|
QgsPointXY where() const;
|
||||||
bool hasWhere();
|
bool hasWhere() const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ValidationMethod
|
enum ValidationMethod
|
||||||
|
@ -3288,3 +3288,18 @@ QDataStream &operator>>( QDataStream &in, QgsGeometry &geometry )
|
|||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString QgsGeometry::Error::what() const
|
||||||
|
{
|
||||||
|
return mMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
QgsPointXY QgsGeometry::Error::where() const
|
||||||
|
{
|
||||||
|
return mLocation;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QgsGeometry::Error::hasWhere() const
|
||||||
|
{
|
||||||
|
return mHasLocation;
|
||||||
|
}
|
||||||
|
@ -1418,27 +1418,28 @@ class CORE_EXPORT QgsGeometry
|
|||||||
*/
|
*/
|
||||||
class CORE_EXPORT Error
|
class CORE_EXPORT Error
|
||||||
{
|
{
|
||||||
QString message;
|
|
||||||
QgsPointXY location;
|
|
||||||
bool hasLocation = false;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Error()
|
Error()
|
||||||
: message( QStringLiteral( "none" ) )
|
: mMessage( QStringLiteral( "none" ) )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
explicit Error( const QString &m )
|
explicit Error( const QString &m )
|
||||||
: message( m )
|
: mMessage( m )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
Error( const QString &m, const QgsPointXY &p )
|
Error( const QString &m, const QgsPointXY &p )
|
||||||
: message( m )
|
: mMessage( m )
|
||||||
, location( p )
|
, mLocation( p )
|
||||||
, hasLocation( true ) {}
|
, mHasLocation( true ) {}
|
||||||
|
|
||||||
QString what() { return message; }
|
QString what() const;
|
||||||
QgsPointXY where() { return location; }
|
QgsPointXY where() const;
|
||||||
bool hasWhere() { return hasLocation; }
|
bool hasWhere() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString mMessage;
|
||||||
|
QgsPointXY mLocation;
|
||||||
|
bool mHasLocation = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user