mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-04 00:04:03 -04:00
Merge pull request #61844 from benoitdm-oslandia/fix/qt6_test_core_qgis
tests: adapt QVariant compare and QgsFlagKeysToValue tests to qt6
This commit is contained in:
commit
ce53380d1e
@ -279,7 +279,7 @@ int qgsVariantCompare( const QVariant &lhs, const QVariant &rhs )
|
||||
}
|
||||
|
||||
default:
|
||||
return QString::localeAwareCompare( lhs.toString(), rhs.toString() );
|
||||
return std::clamp( QString::localeAwareCompare( lhs.toString(), rhs.toString() ), -1, 1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6601,9 +6601,9 @@ template<class T> T qgsFlagKeysToValue( const QString &keys, const T &defaultVal
|
||||
const int intValue = keys.toInt( &canConvert );
|
||||
if ( canConvert )
|
||||
{
|
||||
const QByteArray keys = metaEnum.valueToKeys( intValue );
|
||||
const int intValueCheck = metaEnum.keysToValue( keys );
|
||||
if ( intValue == intValueCheck )
|
||||
const QByteArray keyArray = metaEnum.valueToKeys( intValue );
|
||||
const int intValueCheck = metaEnum.keysToValue( keyArray );
|
||||
if ( !keyArray.isEmpty() && intValue == intValueCheck )
|
||||
{
|
||||
if ( returnOk )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user