From 6cb3e6ec9d79ad27e374ee0614940a6635bd5edb Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Tue, 22 Aug 2023 11:05:50 +0200 Subject: [PATCH] QmlDesigner: Fix top toolbar workspace selection Task-number: QDS-10494 Change-Id: I1f055f7bed7a76df76d733ff8d17e190485ab76d Reviewed-by: Qt CI Patch Build Bot Reviewed-by: Thomas Hartmann --- share/qtcreator/qmldesigner/toolbar/Main.qml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/share/qtcreator/qmldesigner/toolbar/Main.qml b/share/qtcreator/qmldesigner/toolbar/Main.qml index ebed433e724..816e849143d 100644 --- a/share/qtcreator/qmldesigner/toolbar/Main.qml +++ b/share/qtcreator/qmldesigner/toolbar/Main.qml @@ -238,9 +238,7 @@ Rectangle { anchors.right: annotations.left anchors.rightMargin: 10 visible: !root.flyoutEnabled - model: WorkspaceModel { - id: workspaceModel - } + model: WorkspaceModel { id: workspaceModel } textRole: "displayName" valueRole: "fileName" suffix: qsTr(" Workspace") @@ -249,6 +247,7 @@ Rectangle { onCurrentWorkspaceIndexChanged: workspaces.currentIndex = workspaces.currentWorkspaceIndex onActivated: backend.setCurrentWorkspace(workspaces.currentValue) + onCountChanged: workspaces.currentIndex = workspaces.indexOfValue(backend.currentWorkspace) } ToolbarButton {