diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-08-25 00:06:37 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-08-25 00:06:37 (GMT) |
commit | 13fd16e67500e77b8cda34de448cb89ca38a5dab (patch) | |
tree | d9a47b4969c4875d271e7240d46db98aefc0e7f9 /src | |
parent | 6d57d71824ba67cfed07bcb27ab62349ee7d4c6e (diff) | |
download | Qt-13fd16e67500e77b8cda34de448cb89ca38a5dab.zip Qt-13fd16e67500e77b8cda34de448cb89ca38a5dab.tar.gz Qt-13fd16e67500e77b8cda34de448cb89ca38a5dab.tar.bz2 |
Remove unnecessary KeysAttached static map
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/fx/qfxitem.cpp | 19 | ||||
-rw-r--r-- | src/declarative/fx/qfxitem.h | 1 |
2 files changed, 13 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); diff --git a/src/declarative/fx/qfxitem.h b/src/declarative/fx/qfxitem.h index 89c2cf1..222677c 100644 --- a/src/declarative/fx/qfxitem.h +++ b/src/declarative/fx/qfxitem.h @@ -197,6 +197,7 @@ private: QFxAnchorLine verticalCenter() const; QFxAnchorLine baseline() const; + QFxKeysAttached *keyHandler(); void setKeyHandler(QFxKeysAttached *); friend class QmlStatePrivate; |