QmlDesigner: Fix TopLevelComboBoxes

The combobox will break bindings on current index. Therefore
we cannot use a binding on the instances.

Change-Id: I5b4ede02b8b945429b37efa4fc3e1acc15b3fbe7
(cherry picked from commit d61830f91f)
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
Thomas Hartmann
2023-03-17 14:25:40 +01:00
parent 9f725de283
commit d3ae723558
2 changed files with 7 additions and 3 deletions

View File

@@ -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
}
}
}

View File

@@ -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)