[calamares] Role names for progress model

This commit is contained in:
Adriaan de Groot 2020-03-10 16:56:22 -05:00
parent ba4b42b4ee
commit 04cb5f14f7
2 changed files with 11 additions and 0 deletions

View File

@ -108,3 +108,12 @@ ProgressTreeModel::rowCount( const QModelIndex& parent ) const
const Calamares::ViewManager* vm = Calamares::ViewManager::instance();
return vm ? vm->viewSteps().length() : 0;
}
QHash< int, QByteArray >
ProgressTreeModel::roleNames() const
{
auto h = QAbstractListModel::roleNames();
h.insert( ProgressTreeItemCurrentRole, "current" );
h.insert( ProgressTreeItemCompletedRole, "completed" );
return h;
}

View File

@ -40,6 +40,8 @@ public:
QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const override;
int rowCount( const QModelIndex& parent = QModelIndex() ) const override;
QHash< int, QByteArray > roleNames() const override;
};
#endif // PROGRESSTREEMODEL_H