Skip to content
Permalink
Browse files

Don't use broken qHash< QList<...> > on Qt < 5.6

Results in infinite recursion
  • Loading branch information
nyalldawson committed Jul 7, 2017
1 parent e8177b7 commit 3a31f54b15aa66476c548cd44d22fd792ab04d54
Showing with 21 additions and 0 deletions.
  1. +21 −0 src/core/qgis.cpp
@@ -247,9 +247,30 @@ uint qHash( const QVariant &variant )
case QVariant::Char:
return qHash( variant.toChar() );
case QVariant::List:

#if QT_VERSION >= 0x050600
return qHash( variant.toList() );
#else
{
QVariantList list = variant.toList();
if ( list.isEmpty() )
return -1;
else
return qHash( list.at( 0 ) );
}
#endif
case QVariant::StringList:
#if QT_VERSION >= 0x050600
return qHash( variant.toStringList() );
#else
{
QStringList list = variant.toStringList();
if ( list.isEmpty() )
return -1;
else
return qHash( list.at( 0 ) );
}
#endif
case QVariant::ByteArray:
return qHash( variant.toByteArray() );
case QVariant::Date:

0 comments on commit 3a31f54

Please sign in to comment.
You can’t perform that action at this time.