Skip to content
Permalink
Browse files

drop qMapLessThanKey in Qt6 builds

  • Loading branch information
3nids committed Mar 24, 2021
1 parent 4fb05e9 commit ea7fc3c37e0add8d1a269850f73a40f1eb61f9b7
Showing with 9 additions and 1 deletion.
  1. +1 −0 python/core/auto_generated/qgis.sip.in
  2. +2 −0 src/core/qgis.cpp
  3. +4 −1 src/core/qgis.h
  4. +2 −0 src/core/qgscoordinatetransformcontext.cpp
@@ -262,6 +262,7 @@ QVariant data types (such as strings, numeric values, dates and times)




QString qgsVsiPrefix( const QString &path );


@@ -295,10 +295,12 @@ QString Qgis::devVersion()
return QString::fromUtf8( QGIS_DEV_VERSION );
}

#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
template<>
bool qMapLessThanKey<QVariantList>( const QVariantList &key1, const QVariantList &key2 )
{
// qt's built in qMapLessThanKey for QVariantList is broken and does a case-insensitive operation.
// this breaks QMap< QVariantList, ... >, where key matching incorrectly becomes case-insensitive..!!?!
return qgsVariantGreaterThan( key1, key2 ) && key1 != key2;
}
#endif
@@ -561,11 +561,14 @@ CORE_EXPORT bool qgsVariantEqual( const QVariant &lhs, const QVariant &rhs );
*/
CORE_EXPORT bool qgsVariantGreaterThan( const QVariant &lhs, const QVariant &rhs );


#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)

/**
* Compares two QVariantList values and returns whether the first is less than the second.
*/
template<> CORE_EXPORT bool qMapLessThanKey<QVariantList>( const QVariantList &key1, const QVariantList &key2 ) SIP_SKIP;

#endif

CORE_EXPORT QString qgsVsiPrefix( const QString &path );

@@ -26,6 +26,7 @@ QString crsToKey( const QgsCoordinateReferenceSystem &crs )
return crs.authid().isEmpty() ? crs.toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED ) : crs.authid();
}

#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
template<>
bool qMapLessThanKey<QPair<QgsCoordinateReferenceSystem, QgsCoordinateReferenceSystem>>( const QPair<QgsCoordinateReferenceSystem, QgsCoordinateReferenceSystem> &key1,
const QPair<QgsCoordinateReferenceSystem, QgsCoordinateReferenceSystem> &key2 )
@@ -34,6 +35,7 @@ bool qMapLessThanKey<QPair<QgsCoordinateReferenceSystem, QgsCoordinateReferenceS
const QPair< QString, QString > key2String = qMakePair( crsToKey( key2.first ), crsToKey( key2.second ) );
return key1String < key2String;
}
#endif

QgsCoordinateTransformContext::QgsCoordinateTransformContext()
: d( new QgsCoordinateTransformContextPrivate() )

0 comments on commit ea7fc3c

Please sign in to comment.