2 #include <QAbstractItemModel>
6 class ScoreTreeModel : public QAbstractItemModel
13 enum Roles {Type=Qt::UserRole, Rounds, Total, TotalIn, TotalOut, ScoreBest, ScoreAvg };
15 ScoreTreeModel(QList <Score *> &scoreList, QObject *parent = 0);
16 int rowCount(const QModelIndex & parent) const;
17 int columnCount(const QModelIndex & parent) const;
18 QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
19 QModelIndex parent(const QModelIndex &index) const;
20 QVariant data(const QModelIndex & index, int role) const;
21 QVariant headerData(int section, Qt::Orientation orientation, int role) const;
23 void setupModelData(QList<Score *> &scoreList, TreeItem *parent);
26 TreeItem *itemFromIndex(const QModelIndex &index) const;