summaryrefslogtreecommitdiff
path: root/examples/tools/contiguouscache/randomlistmodel.h
diff options
context:
space:
mode:
authorIan Walters <ian.walters@nokia.com>2009-04-03 12:44:38 +1000
committerIan Walters <ian.walters@nokia.com>2009-04-03 12:44:38 +1000
commit423d6052844b2026c8acc8826d6546d3afc494d3 (patch)
treeffc1fb184d157f4211f817b995ddf353b4464631 /examples/tools/contiguouscache/randomlistmodel.h
parent0d00798f6bdd098dbb59c6f1da5be5efd6c283fa (diff)
downloadqt4-tools-423d6052844b2026c8acc8826d6546d3afc494d3.tar.gz
Rename OffsetVector to ContiguousCache
Diffstat (limited to 'examples/tools/contiguouscache/randomlistmodel.h')
-rw-r--r--examples/tools/contiguouscache/randomlistmodel.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/examples/tools/contiguouscache/randomlistmodel.h b/examples/tools/contiguouscache/randomlistmodel.h
new file mode 100644
index 0000000000..ad8cfad384
--- /dev/null
+++ b/examples/tools/contiguouscache/randomlistmodel.h
@@ -0,0 +1,26 @@
+#ifndef RANDOMLISTMODEL_H
+#define RANDOMLISTMODEL_H
+
+#include <QContiguousCache>
+#include <QAbstractListModel>
+
+class QTimer;
+class RandomListModel : public QAbstractListModel
+{
+ Q_OBJECT
+public:
+ RandomListModel(QObject *parent = 0);
+ ~RandomListModel();
+
+ int rowCount(const QModelIndex & = QModelIndex()) const;
+ QVariant data(const QModelIndex &, int) const;
+
+private:
+ void cacheRows(int, int) const;
+ QString fetchRow(int) const;
+
+ mutable QContiguousCache<QString> m_rows;
+ const int m_count;
+};
+
+#endif