diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-04-28 01:32:24 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-04-28 01:32:24 (GMT) |
commit | 4927fb460e12ee8b4dada1025ad042d2b6b9b6f4 (patch) | |
tree | 512d035357c8b56859c01ca7d211b86ec986787d /src/declarative/fx/qfxpathview.cpp | |
parent | eae3489b3f2fba9d733ca50eb89dc92a6e96e6f8 (diff) | |
download | Qt-4927fb460e12ee8b4dada1025ad042d2b6b9b6f4.zip Qt-4927fb460e12ee8b4dada1025ad042d2b6b9b6f4.tar.gz Qt-4927fb460e12ee8b4dada1025ad042d2b6b9b6f4.tar.bz2 |
Use QObject declarative data to store attached properties.
An element's qmlAttachedProperties() function will now only ever get called once
per object.
Diffstat (limited to 'src/declarative/fx/qfxpathview.cpp')
-rw-r--r-- | src/declarative/fx/qfxpathview.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/declarative/fx/qfxpathview.cpp b/src/declarative/fx/qfxpathview.cpp index 1bf7dda..59c7cd1 100644 --- a/src/declarative/fx/qfxpathview.cpp +++ b/src/declarative/fx/qfxpathview.cpp @@ -830,11 +830,9 @@ void QFxPathViewPrivate::snapToCurrent() QHash<QObject*, QObject*> QFxPathView::attachedProperties; QObject *QFxPathView::qmlAttachedProperties(QObject *obj) { - if(!attachedProperties.contains(obj)) { - QFxPathViewAttached *rv = new QFxPathViewAttached(obj); - attachedProperties.insert(obj, rv); - } - return attachedProperties.value(obj); + QFxPathViewAttached *rv = new QFxPathViewAttached(obj); + attachedProperties.insert(obj, rv); + return rv; } QT_END_NAMESPACE |