QgsVariantDelegate::type(): make it obvious to cppcheck that we don't care about the return value of str.toInt()/toDouble()

This commit is contained in:
Even Rouault 2020-05-29 00:57:20 +02:00
parent 7278e747f4
commit 0b2b78a149
No known key found for this signature in database
GPG Key ID: 33EBBFC47B3DD87D

View File

@ -361,12 +361,12 @@ QVariant::Type QgsVariantDelegate::type( const QVariant &value )
// is this an int?
// perhaps we should treat as double for more flexibility
str.toInt( &ok );
( void ) str.toInt( &ok );
if ( ok )
return QVariant::Int;
// is this a double?
str.toDouble( &ok );
( void ) str.toDouble( &ok );
if ( ok )
return QVariant::Double;