[libcalamaresui] Expose currentIndex also as model data

This commit is contained in:
Adriaan de Groot 2020-03-30 14:10:20 +02:00
parent b8962cec2d
commit aad79f664e
2 changed files with 4 additions and 1 deletions

View File

@ -559,6 +559,8 @@ ViewManager::data( const QModelIndex& index, int role ) const
{ {
return QVariant(); return QVariant();
} }
case ProgressTreeItemCurrentIndex:
return m_currentStep;
case ProgressTreeItemCurrentRole: case ProgressTreeItemCurrentRole:
return currentStep() == step; return currentStep() == step;
case ProgressTreeItemCompletedRole: case ProgressTreeItemCompletedRole:

View File

@ -154,7 +154,8 @@ public:
enum Role enum Role
{ {
ProgressTreeItemCurrentRole = Qt::UserRole + 11, ///< Is this the *current* step? ProgressTreeItemCurrentRole = Qt::UserRole + 11, ///< Is this the *current* step?
ProgressTreeItemCompletedRole = Qt::UserRole + 12 ///< Are we past this one? ProgressTreeItemCompletedRole = Qt::UserRole + 12, ///< Are we past this one?
ProgressTreeItemCurrentIndex = Qt::UserRole + 13 ///< Index (row) of the current step
}; };
QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const override; QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const override;