diff options
Diffstat (limited to 'src/declarative/fx/qfxitem.cpp')
-rw-r--r-- | src/declarative/fx/qfxitem.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index feb4e8c..ed2386b 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -704,7 +704,6 @@ private: }; static const SigMap sigMap[]; - static QHash<QObject*, QFxKeysAttached*> attachedProperties; friend class QFxItem; }; @@ -738,8 +737,6 @@ const QFxKeysAttached::SigMap QFxKeysAttached::sigMap[] = { { 0, 0 } }; -QHash<QObject*, QFxKeysAttached*> QFxKeysAttached::attachedProperties; - bool QFxKeysAttachedPrivate::isConnected(const char *signalName) { return isSignalConnected(signalIndex(signalName)); @@ -796,10 +793,12 @@ void QFxKeysAttached::keyReleased(QKeyEvent *event) QFxKeysAttached *QFxKeysAttached::qmlAttachedProperties(QObject *obj) { - QFxKeysAttached *rv = attachedProperties.value(obj); - if (!rv) { - rv = new QFxKeysAttached(obj); - attachedProperties.insert(obj, rv); + QFxKeysAttached *rv = 0; + QFxItem *item = qobject_cast<QFxItem*>(obj); + if (item) { + rv = item->keyHandler(); + if (!rv) + rv = new QFxKeysAttached(obj); } return rv; } @@ -1423,6 +1422,12 @@ void QFxItem::geometryChanged(const QRectF &newGeometry, } } +QFxKeysAttached *QFxItem::keyHandler() +{ + Q_D(QFxItem); + return d->keyHandler; +} + void QFxItem::setKeyHandler(QFxKeysAttached *handler) { Q_D(QFxItem); |