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 {