Changed URLs. Added open/close to QBuffer buffers.
[speedfreak] / Client / stringlistmodel.h
1 /*
2  * Stringlistmodel class
3  *
4  * @author      Toni Jussila <toni.jussila@fudeco.com>
5  * @copyright   (c) 2010 Speed Freak team
6  * @license     http://opensource.org/licenses/gpl-license.php GNU Public License
7  * @exaple      http://qt.nokia.com/doc/4.0/qt4-interview.html#example-code
8  */
9
10 #ifndef STRINGLISTMODEL_H
11 #define STRINGLISTMODEL_H
12 #include <QAbstractListModel>
13 #include <QObject>
14 #include <QStringList>
15
16 class StringListModel : public QAbstractListModel
17 {
18     Q_OBJECT
19 public:
20     StringListModel(const QStringList &strings, QObject *parent = 0):QAbstractListModel(parent), stringList(strings) {}
21     int rowCount(const QModelIndex &parent = QModelIndex()) const;
22     QVariant data(const QModelIndex &index, int role) const;
23     QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
24
25 private:
26     QStringList stringList;
27 };
28
29 #endif // STRINGLISTMODEL_H