Skip to content

Commit

Permalink
Prevent conversion of QString to QVariantList
Browse files Browse the repository at this point in the history
  • Loading branch information
cantunca-pointr committed Jul 20, 2022
1 parent 86e6a5d commit 5a384e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions platform/qt/src/utils/conversion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class ConversionTraits<QVariant> {

static bool isArray(const QVariant& value) {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
if (value.typeId() == QMetaType::QString) {
// QString is convertible to a QChar list, which we don't want
return false;
}
return QMetaType::canConvert(value.metaType(), QMetaType(QMetaType::QVariantList));
#else
return value.canConvert(QVariant::List);
Expand Down

0 comments on commit 5a384e7

Please sign in to comment.