From aad79f664eaed90776e1dd843cb85ef0a885333a Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 30 Mar 2020 14:10:20 +0200 Subject: [PATCH] [libcalamaresui] Expose currentIndex also as model data --- src/libcalamaresui/ViewManager.cpp | 2 ++ src/libcalamaresui/ViewManager.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libcalamaresui/ViewManager.cpp b/src/libcalamaresui/ViewManager.cpp index 9972c3af9..1499e3653 100644 --- a/src/libcalamaresui/ViewManager.cpp +++ b/src/libcalamaresui/ViewManager.cpp @@ -559,6 +559,8 @@ ViewManager::data( const QModelIndex& index, int role ) const { return QVariant(); } + case ProgressTreeItemCurrentIndex: + return m_currentStep; case ProgressTreeItemCurrentRole: return currentStep() == step; case ProgressTreeItemCompletedRole: diff --git a/src/libcalamaresui/ViewManager.h b/src/libcalamaresui/ViewManager.h index 3ca02bc55..2c12aac6b 100644 --- a/src/libcalamaresui/ViewManager.h +++ b/src/libcalamaresui/ViewManager.h @@ -154,7 +154,8 @@ public: enum Role { 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;