diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-02-20 07:42:16 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-02-20 07:42:16 (GMT) |
commit | f0eb658611f549470f0d90e141eda61ab9301838 (patch) | |
tree | e234b73e10490e297033d645b744a7cbd26da4b9 /src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp | |
parent | ba9c21f7a1398ddcdeee6f010b1477d79f5bb8ce (diff) | |
parent | 8f10ca802dee1ed110f301191c4a56a85575033c (diff) | |
download | Qt-f0eb658611f549470f0d90e141eda61ab9301838.zip Qt-f0eb658611f549470f0d90e141eda61ab9301838.tar.gz Qt-f0eb658611f549470f0d90e141eda61ab9301838.tar.bz2 |
Merge remote branch 'origin/master'
Conflicts:
doc/src/declarative/advtutorial1.qdoc
Diffstat (limited to 'src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp | 46 |
1 files changed, 2 insertions, 44 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp b/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp index ae045ae..ac60dbf 100644 --- a/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp @@ -62,48 +62,8 @@ #include <private/qobject_p.h> -QML_DECLARE_TYPE(QListModelInterface) - QT_BEGIN_NAMESPACE -class QmlGraphicsVisualItemModelAttached : public QObject -{ - Q_OBJECT - -public: - QmlGraphicsVisualItemModelAttached(QObject *parent) - : QObject(parent), m_index(0) {} - ~QmlGraphicsVisualItemModelAttached() { - attachedProperties.remove(parent()); - } - - Q_PROPERTY(int index READ index NOTIFY indexChanged) - int index() const { return m_index; } - void setIndex(int idx) { - if (m_index != idx) { - m_index = idx; - emit indexChanged(); - } - } - - static QmlGraphicsVisualItemModelAttached *properties(QObject *obj) { - QmlGraphicsVisualItemModelAttached *rv = attachedProperties.value(obj); - if (!rv) { - rv = new QmlGraphicsVisualItemModelAttached(obj); - attachedProperties.insert(obj, rv); - } - return rv; - } - -Q_SIGNALS: - void indexChanged(); - -public: - int m_index; - - static QHash<QObject*, QmlGraphicsVisualItemModelAttached*> attachedProperties; -}; - QHash<QObject*, QmlGraphicsVisualItemModelAttached*> QmlGraphicsVisualItemModelAttached::attachedProperties; @@ -1147,10 +1107,8 @@ void QmlGraphicsVisualDataModel::_q_destroyingPackage(QmlPackage *package) emit destroyingItem(qobject_cast<QmlGraphicsItem*>(package->part(d->m_part))); } -QML_DEFINE_NOCREATE_TYPE(QmlGraphicsVisualModel); -QML_DEFINE_TYPE(Qt,4,6,VisualItemModel,QmlGraphicsVisualItemModel) -QML_DEFINE_TYPE(Qt,4,6,VisualDataModel,QmlGraphicsVisualDataModel) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QListModelInterface) + #include <qmlgraphicsvisualitemmodel.moc> |