Skip to content

Commit

Permalink
[qt6] Allow using QCoordinateReferenceSystem in QMap
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn authored and nyalldawson committed Mar 31, 2021
1 parent 666fcda commit 81c372d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/core/qgscoordinatereferencesystem.cpp
Expand Up @@ -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;
}
9 changes: 9 additions & 0 deletions src/core/qgscoordinatereferencesystem.h
Expand Up @@ -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 );
};
Expand Down Expand Up @@ -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

0 comments on commit 81c372d

Please sign in to comment.