Fix compiling with legacy Qt (aka Qt5)

This commit is contained in:
Matthias Kuhn 2021-03-25 12:22:35 +01:00
parent 42b79396b4
commit 20596227f7
2 changed files with 4 additions and 0 deletions

View File

@ -259,6 +259,7 @@ QVariant data types (such as strings, numeric values, dates and times)
.. seealso:: :py:func:`qgsVariantLessThan`
%End
bool operator> ( const QVariant &v1, const QVariant &v2 );
bool operator< ( const QVariant &v1, const QVariant &v2 );

View File

@ -552,6 +552,8 @@ 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 QVariant values and returns whether the first is greater than the second.
* Useful for sorting lists of variants, correctly handling sorting of the various
@ -576,6 +578,7 @@ inline bool operator< ( const QVariant &v1, const QVariant &v2 )
{
return qgsVariantLessThan( v1, v2 );
}
#endif
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)