From d3ae7235588d1288e34d56e7c690bdc137207291 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Fri, 17 Mar 2023 14:25:40 +0100 Subject: [PATCH] QmlDesigner: Fix TopLevelComboBoxes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The combobox will break bindings on current index. Therefore we cannot use a binding on the instances. Change-Id: I5b4ede02b8b945429b37efa4fc3e1acc15b3fbe7 (cherry picked from commit d61830f91f5a6060ab5eaa73e77a2fa9d7e0db35) Reviewed-by: Henning Gründl --- share/qtcreator/qmldesigner/statusbar/Main.qml | 3 ++- share/qtcreator/qmldesigner/toolbar/Main.qml | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/share/qtcreator/qmldesigner/statusbar/Main.qml b/share/qtcreator/qmldesigner/statusbar/Main.qml index 1310da45f63..db1a125e10f 100644 --- a/share/qtcreator/qmldesigner/statusbar/Main.qml +++ b/share/qtcreator/qmldesigner/statusbar/Main.qml @@ -77,7 +77,8 @@ Item { onActivated: backend.setCurrentStyle(styles.currentIndex) openUpwards: true enabled: backend.isInDesignMode - currentIndex: backend.currentStyle + property int currentStyleIndex: backend.currentStyle + onCurrentStyleIndexChanged: currentIndex = backend.currentStyle } } } diff --git a/share/qtcreator/qmldesigner/toolbar/Main.qml b/share/qtcreator/qmldesigner/toolbar/Main.qml index 8579c21a0b6..69d85073b1b 100644 --- a/share/qtcreator/qmldesigner/toolbar/Main.qml +++ b/share/qtcreator/qmldesigner/toolbar/Main.qml @@ -137,8 +137,9 @@ Rectangle { anchors.left: livePreviewButton.right anchors.leftMargin: 10 model: backend.documentModel - currentIndex: backend.documentIndex + property int currentDocumentIndex: backend.documentIndex + onCurrentDocumentIndexChanged: currentFile.currentIndex = currentFile.currentDocumentIndex onActivated: backend.openFileByIndex(index) } @@ -237,7 +238,9 @@ Rectangle { anchors.right: annotations.left anchors.rightMargin: 10 model: backend.workspaces - currentIndex: workspaces.find(backend.currentWorkspace) + property int currentWorkspaceIndex: workspaces.find(backend.currentWorkspace) + onCurrentWorkspaceIndexChanged: workspaces.currentIndex = workspaces.currentWorkspaceIndex + visible: !root.flyoutEnabled onActivated: backend.setCurrentWorkspace(workspaces.currentText)