aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-06-07 12:06:14 +0200
committerLiang Qi <liang.qi@qt.io>2017-06-07 12:06:15 +0200
commit55490690f81eba168b06a90e4a66cefc20b38252 (patch)
tree9c6b6b9234aa767af1c69cac4d4cf896f292be20 /src/imports
parent5624e82d068ebab254239121810fc097af7fcb40 (diff)
parentd8f84e5769632544dfac5138348481330c4da4cd (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/builtins/builtins.qmltypes3
-rw-r--r--src/imports/qtquick2/plugins.qmltypes2
-rw-r--r--src/imports/settings/qqmlsettings.cpp18
3 files changed, 18 insertions, 5 deletions
diff --git a/src/imports/builtins/builtins.qmltypes b/src/imports/builtins/builtins.qmltypes
index ac95a8837b..c2f8f5b521 100644
--- a/src/imports/builtins/builtins.qmltypes
+++ b/src/imports/builtins/builtins.qmltypes
@@ -426,7 +426,8 @@ Module {
"WA_X11DoNotAcceptFocus": 126,
"WA_MacNoShadow": 127,
"WA_AlwaysStackOnTop": 128,
- "WA_AttributeCount": 129
+ "WA_TabletTracking": 129,
+ "WA_AttributeCount": 130
}
}
Enum {
diff --git a/src/imports/qtquick2/plugins.qmltypes b/src/imports/qtquick2/plugins.qmltypes
index a9534b5ccc..834b4bfac2 100644
--- a/src/imports/qtquick2/plugins.qmltypes
+++ b/src/imports/qtquick2/plugins.qmltypes
@@ -1414,7 +1414,7 @@ Module {
Property { name: "source"; type: "QObject"; isPointer: true }
Property { name: "target"; type: "QObject"; isReadonly: true; isPointer: true }
Property { name: "hotSpot"; type: "QPointF" }
- Property { name: "imageSource"; revision: 8; type: "QUrl" }
+ Property { name: "imageSource"; type: "QUrl" }
Property { name: "keys"; type: "QStringList" }
Property { name: "mimeData"; type: "QVariantMap" }
Property { name: "supportedActions"; type: "Qt::DropActions" }
diff --git a/src/imports/settings/qqmlsettings.cpp b/src/imports/settings/qqmlsettings.cpp
index cd6fcbc718..df67c04654 100644
--- a/src/imports/settings/qqmlsettings.cpp
+++ b/src/imports/settings/qqmlsettings.cpp
@@ -41,6 +41,7 @@
#include <qcoreevent.h>
#include <qsettings.h>
#include <qpointer.h>
+#include <qjsvalue.h>
#include <qdebug.h>
#include <qhash.h>
@@ -241,6 +242,7 @@ public:
void store();
void _q_propertyChanged();
+ QVariant readProperty(const QMetaProperty &property) const;
QQmlSettings *q_ptr;
int timerId;
@@ -295,7 +297,7 @@ void QQmlSettingsPrivate::load()
for (int i = offset; i < count; ++i) {
QMetaProperty property = mo->property(i);
- const QVariant previousValue = property.read(q);
+ const QVariant previousValue = readProperty(property);
const QVariant currentValue = instance()->value(property.name(), previousValue);
if (!currentValue.isNull() && (!previousValue.isValid()
@@ -340,9 +342,10 @@ void QQmlSettingsPrivate::_q_propertyChanged()
const int count = mo->propertyCount();
for (int i = offset; i < count; ++i) {
const QMetaProperty &property = mo->property(i);
- changedProperties.insert(property.name(), property.read(q));
+ const QVariant value = readProperty(property);
+ changedProperties.insert(property.name(), value);
#ifdef SETTINGS_DEBUG
- qDebug() << "QQmlSettings: cache" << property.name() << ":" << property.read(q);
+ qDebug() << "QQmlSettings: cache" << property.name() << ":" << value;
#endif
}
if (timerId != 0)
@@ -350,6 +353,15 @@ void QQmlSettingsPrivate::_q_propertyChanged()
timerId = q->startTimer(settingsWriteDelay);
}
+QVariant QQmlSettingsPrivate::readProperty(const QMetaProperty &property) const
+{
+ Q_Q(const QQmlSettings);
+ QVariant var = property.read(q);
+ if (var.userType() == qMetaTypeId<QJSValue>())
+ var = var.value<QJSValue>().toVariant();
+ return var;
+}
+
QQmlSettings::QQmlSettings(QObject *parent)
: QObject(parent), d_ptr(new QQmlSettingsPrivate)
{