aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4qobjectwrapper_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2015-06-04 10:24:46 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-06-04 10:28:48 +0200
commit9556f6d075b61fa95d6e1057f305e522a26f71d6 (patch)
tree53190472453390810c47b9b5a47b23188a00267e /src/qml/jsruntime/qv4qobjectwrapper_p.h
parent42ffe9b193a5bd958b0853233fd0d94170722bd1 (diff)
parent1fd0cdc6a2e01775d8a79c6614910cc5a2fbf2b3 (diff)
Merge remote-tracking branch 'origin/5.5' into dev
Conflicts: src/qml/jsruntime/qv4engine_p.h src/quick/items/qquickitemsmodule.cpp src/quick/items/qquicktext.cpp src/quick/util/qquickpixmapcache.cpp tests/auto/quick/qquickwindow/tst_qquickwindow.cpp Change-Id: I90ecaad6a4bfaa4f36149a7463f4d7141f4a516a
Diffstat (limited to 'src/qml/jsruntime/qv4qobjectwrapper_p.h')
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper_p.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper_p.h b/src/qml/jsruntime/qv4qobjectwrapper_p.h
index 1308e304b6..ac7aad3378 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper_p.h
+++ b/src/qml/jsruntime/qv4qobjectwrapper_p.h
@@ -110,6 +110,7 @@ struct Q_QML_EXPORT QObjectWrapper : public Object
static bool setQmlProperty(ExecutionEngine *engine, QQmlContextData *qmlContext, QObject *object, String *name, RevisionMode revisionMode, const Value &value);
static ReturnedValue wrap(ExecutionEngine *engine, QObject *object);
+ static void markWrapper(QObject *object, ExecutionEngine *engine);
using Object::get;
@@ -173,22 +174,23 @@ struct QmlSignalHandler : public QV4::Object
};
class MultiplyWrappedQObjectMap : public QObject,
- private QHash<QObject*, Object*>
+ private QHash<QObject*, QV4::WeakValue>
{
Q_OBJECT
public:
- typedef QHash<QObject*, Object*>::ConstIterator ConstIterator;
- typedef QHash<QObject*, Object*>::Iterator Iterator;
+ typedef QHash<QObject*, QV4::WeakValue>::ConstIterator ConstIterator;
+ typedef QHash<QObject*, QV4::WeakValue>::Iterator Iterator;
- ConstIterator begin() const { return QHash<QObject*, Object*>::constBegin(); }
- Iterator begin() { return QHash<QObject*, Object*>::begin(); }
- ConstIterator end() const { return QHash<QObject*, Object*>::constEnd(); }
- Iterator end() { return QHash<QObject*, Object*>::end(); }
+ ConstIterator begin() const { return QHash<QObject*, QV4::WeakValue>::constBegin(); }
+ Iterator begin() { return QHash<QObject*, QV4::WeakValue>::begin(); }
+ ConstIterator end() const { return QHash<QObject*, QV4::WeakValue>::constEnd(); }
+ Iterator end() { return QHash<QObject*, QV4::WeakValue>::end(); }
- void insert(QObject *key, Object *value);
- Object *value(QObject *key) const { return QHash<QObject*, Object*>::value(key, 0); }
+ void insert(QObject *key, Heap::Object *value);
+ ReturnedValue value(QObject *key) const { return QHash<QObject*, QV4::WeakValue>::value(key).value(); }
Iterator erase(Iterator it);
void remove(QObject *key);
+ void mark(QObject *key, ExecutionEngine *engine);
private Q_SLOTS:
void removeDestroyedObject(QObject*);