diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-04-12 10:42:56 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-04-12 12:13:54 +0000 |
commit | 0af154c41dc0dfbf5994e7eb3056b2333b5645b7 (patch) | |
tree | 8e923f9f8c971ca95bf618ef2b4e22c396a36110 /src/qml/jsruntime | |
parent | 72a16358112512c49022a8f80432d2d3a330fff2 (diff) |
Don't create value types for QImage and QPixmap
Those are "scarce" resources which need to be kept as QVariant.
Fixes: QTBUG-74751
Change-Id: I28381e2a754ed4bbf4e409dc275f6288b64416cc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index bcd577c24d..bd1124beb6 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -1537,6 +1537,10 @@ QV4::ReturnedValue QV4::ExecutionEngine::fromVariant(const QVariant &variant) case QMetaType::QLocale: return QQmlLocale::wrap(this, *reinterpret_cast<const QLocale*>(ptr)); #endif + case QMetaType::QPixmap: + case QMetaType::QImage: + // Scarce value types + return QV4::Encode(newVariantObject(variant)); default: break; } |