diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index ccfa7d0d38..0ffc22d810 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -319,7 +319,7 @@ template inline bool qt_convertToBool(const QVariant::Private *const d) { TInput str = v_cast(d)->toLower(); - return !(str == LiteralWrapper("0") || str == LiteralWrapper("false") || str.isEmpty()); + return !(str.isEmpty() || str == LiteralWrapper("0") || str == LiteralWrapper("false")); } /*! @@ -700,7 +700,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) bool *b = static_cast(result); switch(d->type) { case QVariant::ByteArray: - *b = qt_convertToBool(d); + *b = qt_convertToBool(d); break; case QVariant::String: *b = qt_convertToBool(d);