aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qquicklistmodel_p.h
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2012-07-10 17:01:52 +1000
committerQt by Nokia <qt-info@nokia.com>2012-07-25 02:15:15 +0200
commit7daab8039abc32ab5be5706a08cb58905fe0e0b6 (patch)
tree9ceb8afdeb37ac4d9bc089545e73e31040b847e4 /src/qml/qml/qquicklistmodel_p.h
parentb355aacb6e5c4f9b7ebb317125409ea0959d11d6 (diff)
Remove QListModelInterface.
Implement ListModel and XmlListModel using QAbstractListModel instead. Task-number: QTBUG-15728 Change-Id: I14e03d90883d341f4b1d89c1e9fc9dc1534fde78 Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
Diffstat (limited to 'src/qml/qml/qquicklistmodel_p.h')
-rw-r--r--src/qml/qml/qquicklistmodel_p.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/qml/qml/qquicklistmodel_p.h b/src/qml/qml/qquicklistmodel_p.h
index 2941de9148..827831e11e 100644
--- a/src/qml/qml/qquicklistmodel_p.h
+++ b/src/qml/qml/qquicklistmodel_p.h
@@ -50,7 +50,7 @@
#include <QtCore/QHash>
#include <QtCore/QList>
#include <QtCore/QVariant>
-#include "qlistmodelinterface_p.h"
+#include <QtCore/qabstractitemmodel.h>
#include <private/qv8engine_p.h>
#include <private/qpodvector_p.h>
@@ -64,7 +64,7 @@ class QQuickListModelWorkerAgent;
class ListModel;
class ListLayout;
-class Q_QML_PRIVATE_EXPORT QQuickListModel : public QListModelInterface
+class Q_QML_PRIVATE_EXPORT QQuickListModel : public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY(int count READ count NOTIFY countChanged)
@@ -74,10 +74,13 @@ public:
QQuickListModel(QObject *parent=0);
~QQuickListModel();
- virtual QList<int> roles() const;
- virtual QString toString(int role) const;
- virtual int count() const;
- virtual QVariant data(int index, int role) const;
+ QModelIndex index(int row, int column, const QModelIndex &parent) const;
+ int rowCount(const QModelIndex &parent) const;
+ QVariant data(const QModelIndex &index, int role) const;
+ QHash<int,QByteArray> roleNames() const;
+
+ QVariant data(int index, int role) const;
+ int count() const;
Q_INVOKABLE void clear();
Q_INVOKABLE void remove(QQmlV8Function *args);
@@ -142,7 +145,7 @@ private:
static void sync(QQuickListModel *src, QQuickListModel *target, QHash<int, QQuickListModel *> *targetModelHash);
static QQuickListModel *createWithOwner(QQuickListModel *newOwner);
- void emitItemsChanged(int index, int count, const QList<int> &roles);
+ void emitItemsChanged(int index, int count, const QVector<int> &roles);
void emitItemsRemoved(int index, int count);
void emitItemsInserted(int index, int count);
void emitItemsMoved(int from, int to, int n);