summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-12-18 05:57:45 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-12-18 05:57:45 (GMT)
commitd8c5cb56d58683575842e19a6c849ab042b9dc82 (patch)
tree4a463cb49de5276d672942cd7e58bf718bb8b43e
parentb81c98fa78e3f99e498dad8d040284e6d1359a68 (diff)
parent6a7272687080abcc4d79ba3c1a8fd44ad23a1206 (diff)
downloadQt-d8c5cb56d58683575842e19a6c849ab042b9dc82.zip
Qt-d8c5cb56d58683575842e19a6c849ab042b9dc82.tar.gz
Qt-d8c5cb56d58683575842e19a6c849ab042b9dc82.tar.bz2
Merge branch 'kinetic-declarativeui' of scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r--src/declarative/graphicsitems/qmlgraphicslistview.cpp24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp
index 51d88ed..cddf33c 100644
--- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp
@@ -91,9 +91,7 @@ class QmlGraphicsListViewAttached : public QObject
public:
QmlGraphicsListViewAttached(QObject *parent)
: QObject(parent), m_view(0), m_isCurrent(false), m_delayRemove(false) {}
- ~QmlGraphicsListViewAttached() {
- attachedProperties.remove(parent());
- }
+ ~QmlGraphicsListViewAttached() {}
Q_PROPERTY(QmlGraphicsListView *view READ view CONSTANT)
QmlGraphicsListView *view() { return m_view; }
@@ -134,15 +132,6 @@ public:
}
}
- static QmlGraphicsListViewAttached *properties(QObject *obj) {
- QmlGraphicsListViewAttached *rv = attachedProperties.value(obj);
- if (!rv) {
- rv = new QmlGraphicsListViewAttached(obj);
- attachedProperties.insert(obj, rv);
- }
- return rv;
- }
-
void emitAdd() { emit add(); }
void emitRemove() { emit remove(); }
@@ -160,20 +149,17 @@ public:
mutable QString m_section;
QString m_prevSection;
bool m_delayRemove;
-
- static QHash<QObject*, QmlGraphicsListViewAttached*> attachedProperties;
};
-QHash<QObject*, QmlGraphicsListViewAttached*> QmlGraphicsListViewAttached::attachedProperties;
-
//----------------------------------------------------------------------------
class FxListItem
{
public:
FxListItem(QmlGraphicsItem *i, QmlGraphicsListView *v) : item(i), section(0), view(v) {
- attached = QmlGraphicsListViewAttached::properties(item);
- attached->m_view = view;
+ attached = static_cast<QmlGraphicsListViewAttached*>(qmlAttachedPropertiesObject<QmlGraphicsListView>(item));
+ if (attached)
+ attached->m_view = view;
}
~FxListItem() {}
qreal position() const {
@@ -2684,7 +2670,7 @@ void QmlGraphicsListView::animStopped()
QmlGraphicsListViewAttached *QmlGraphicsListView::qmlAttachedProperties(QObject *obj)
{
- return QmlGraphicsListViewAttached::properties(obj);
+ return new QmlGraphicsListViewAttached(obj);
}
QML_DEFINE_TYPE(Qt,4,6,ListView,QmlGraphicsListView)