diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2021-02-01 00:50:48 -0500 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2021-02-01 00:50:48 -0500 |
| commit | f22b64f2670ac45ac4c9b7c0c760bf5752086ede (patch) | |
| tree | a22e04cc1116cd77a9e6c5faeddc4701e0d3562a /library.cpp | |
| parent | 1cbb7aa6e651b49e92ef7aaa188e6698ff14635c (diff) | |
| download | erable-godot-aap.tar.gz erable-godot-aap.tar.bz2 erable-godot-aap.zip | |
final commit for qtaap
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 |
