[qt6] Allow using QCoordinateReferenceSystem in QMap

This commit is contained in:
Matthias Kuhn 2021-03-24 16:47:04 +01:00 committed by Nyall Dawson
parent 666fcda9b8
commit 81c372d0a5
2 changed files with 26 additions and 0 deletions

View File

@ -2584,3 +2584,20 @@ void QgsCoordinateReferenceSystem::invalidateCache( bool disableCache )
}
sCrsStringLock()->unlock();
}
bool operator> ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 )
{
return c1.d->mSrsId > c2.d->mSrsId;
}
bool operator< ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 )
{
return c1.d->mSrsId < c2.d->mSrsId;
}
bool operator>= ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 )
{
return c1.d->mSrsId >= c2.d->mSrsId;
}
bool operator<= ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 )
{
return c1.d->mSrsId <= c2.d->mSrsId;
}

View File

@ -983,6 +983,10 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
friend class TestQgsCoordinateReferenceSystem;
friend class QgsPostgresProvider;
friend class QgsCoordinateReferenceSystemRegistry;
friend bool operator> ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 );
friend bool operator< ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 );
friend bool operator>= ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 );
friend bool operator<= ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 );
bool createFromPostgisSrid( const long id );
};
@ -1035,6 +1039,11 @@ inline std::ostream &operator << ( std::ostream &os, const QgsCoordinateReferenc
// Using streams we need to use local 8 Bit
return os << mySummary.toLocal8Bit().data() << std::endl;
}
bool operator> ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 );
bool operator< ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 );
bool operator>= ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 );
bool operator<= ( const QgsCoordinateReferenceSystem &c1, const QgsCoordinateReferenceSystem &c2 );
#endif
#endif // QGSCOORDINATEREFERENCESYSTEM_H