diff options
author | Matthew Vogt <matthew.vogt@nokia.com> | 2012-07-26 14:15:49 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-27 06:09:11 +0200 |
commit | 54c2d685512fdeac2d5b6eeaf25ed738c4fd99ba (patch) | |
tree | 27acf485b787f825525d20b7a160d45fde678360 /src/qml/util/qqmlpropertymap.h | |
parent | 73842034aac7b9788add4f1ba6cf7a9ec6057598 (diff) |
Allow access to signals and slots in QQmlPropertyMap inheritors
Allow inheritors of QQmlPropertyMap to pass the static meta object
information needed to support their signals and slots. If the correct
pointer is not provided to the constructor, it is not accessible via
the virtual metaObject() function during construction.
Task-number: QTBUG-26400
Change-Id: Ide8c6d3568e4abd4c48e0aa60e6fa05a9c2a11cf
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/qml/util/qqmlpropertymap.h')
-rw-r--r-- | src/qml/util/qqmlpropertymap.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/qml/util/qqmlpropertymap.h b/src/qml/util/qqmlpropertymap.h index bfd11e5c80..f7d69be7fb 100644 --- a/src/qml/util/qqmlpropertymap.h +++ b/src/qml/util/qqmlpropertymap.h @@ -82,7 +82,18 @@ Q_SIGNALS: protected: virtual QVariant updateValue(const QString &key, const QVariant &input); + template<class DerivedType> + QQmlPropertyMap(DerivedType *derived, QObject *parent = 0) + : QObject(*allocatePrivate(), parent) + { + Q_UNUSED(derived) + init(&DerivedType::staticMetaObject); + } + private: + void init(const QMetaObject *staticMetaObject); + static QObjectPrivate *allocatePrivate(); + Q_DECLARE_PRIVATE(QQmlPropertyMap) Q_DISABLE_COPY(QQmlPropertyMap) }; |