diff options
Diffstat (limited to 'library.cpp')
| -rw-r--r-- | library.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/library.cpp b/library.cpp index ffba966..f1baf83 100644 --- a/library.cpp +++ b/library.cpp @@ -22,6 +22,24 @@ Library::Library(QObject *parent) { } +QVariant Library::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (role == Qt::DisplayRole) { + switch (section) { + case 0: + return "Name"; + case 1: + return "Artist"; + case 2: + return "Album"; + } + } else if (role == Qt::SizeHintRole) { + return QSize(500, 29); + } + return QAbstractItemModel::headerData(section, orientation, role); +} + + int Library::rowCount(const QModelIndex &parent) const { // For list models only the root node (an invalid parent) should return the list's size. For all |
