2 * Copyright (C) 2009 Sakari Poussa
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, version 2.
13 this->type = TypeRoot;
18 TreeItem::TreeItem(const QString &str)
20 this->type = TypeDate;
26 TreeItem::TreeItem(Score *s)
28 this->type = TypeScore;
30 this->str = s->getDate();
40 int TreeItem::childCount() const
42 return children.count();
45 int TreeItem::columnCount() const
50 void TreeItem::appendChild(TreeItem *item)
53 children.append(item);
56 TreeItem *TreeItem::child(int row)
58 return children.value(row);
61 QVariant TreeItem::data(int column) const
66 int TreeItem::row() const
69 return parent->children.indexOf(const_cast<TreeItem*>(this));