diff options
Diffstat (limited to 'src/mobile/ui/treechoosermodel.cpp')
-rw-r--r-- | src/mobile/ui/treechoosermodel.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mobile/ui/treechoosermodel.cpp b/src/mobile/ui/treechoosermodel.cpp new file mode 100644 index 0000000..cc5e2a7 --- /dev/null +++ b/src/mobile/ui/treechoosermodel.cpp @@ -0,0 +1,22 @@ + +#include "treechoosermodel.h" + + +TreeChooserModel::TreeChooserModel(QObject *parent) + : QAbstractListModel(parent) +{ +} + +QHash<int, QByteArray> TreeChooserModel::roleNames() const { + QHash<int, QByteArray> roles; + roles[NameRole] = "name"; + roles[ChildCountRole] = "childCount"; + return roles; +} + +void TreeChooserModel::addEntry(const QString& name, int childCount) { + int count = rowCount(); + beginInsertRows(count, count); + insertRow(count); + endInsertRows(); +} |