QmlDesigner: Fix Connection editor closing

Pick-to: qds/4.5
Task-number: QDS-12013
Change-Id: I8add3418bb43b87e45153c012353646833413664
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Henning Gruendl
2024-05-13 15:36:03 +02:00
committed by Henning Gründl
parent c29f514543
commit e86814c491
3 changed files with 15 additions and 12 deletions

View File

@@ -11,6 +11,8 @@ StudioControls.PopupDialog {
property alias backend: form.backend property alias backend: form.backend
keepOpen: form.keepOpen
titleBar: Row { titleBar: Row {
spacing: 30 // TODO spacing: 30 // TODO
anchors.fill: parent anchors.fill: parent
@@ -43,6 +45,8 @@ StudioControls.PopupDialog {
ConnectionsDialogForm { ConnectionsDialogForm {
id: form id: form
parentWindow: root.window
Connections { Connections {
target: root.backend target: root.backend
function onPopupShouldClose() { function onPopupShouldClose() {

View File

@@ -16,6 +16,9 @@ Column {
property var backend property var backend
property bool keepOpen: expressionDialogLoader.visible
property Window parentWindow: null
width: parent.width width: parent.width
spacing: root.verticalSpacing spacing: root.verticalSpacing
@@ -267,10 +270,8 @@ Column {
horizontalAlignment: code.lineCount === 1 ? Text.AlignHCenter : Text.AlignLeft horizontalAlignment: code.lineCount === 1 ? Text.AlignHCenter : Text.AlignLeft
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight elide: Text.ElideRight
} }
Loader { Loader {
id: expressionDialogLoader id: expressionDialogLoader
parent: editor parent: editor
@@ -297,19 +298,19 @@ Column {
id: bindingEditor id: bindingEditor
onRejected: { onRejected: {
hideWidget() bindingEditor.hideWidget()
expressionDialogLoader.visible = false expressionDialogLoader.visible = false
} }
onAccepted: { onAccepted: {
backend.setNewSource(bindingEditor.text) backend.setNewSource(bindingEditor.text)
hideWidget() bindingEditor.hideWidget()
expressionDialogLoader.visible = false expressionDialogLoader.visible = false
} }
} }
} }
} // loader }
} // rect }
} //col 2 }
}//col1 }

View File

@@ -104,7 +104,7 @@ QtObject {
return root.maximumHeight + (2 * window.margin) return root.maximumHeight + (2 * window.margin)
} }
visible: false visible: false
flags: Qt.FramelessWindowHint | Qt.Tool | Qt.WindowStaysOnTopHint flags: Qt.FramelessWindowHint | Qt.Tool
color: "transparent" color: "transparent"
onClosing: function (close) { onClosing: function (close) {
@@ -286,10 +286,8 @@ QtObject {
enabled: root.visible enabled: root.visible
function onFocusWindowChanged(focusWindow) { function onFocusWindowChanged(focusWindow) {
if (!focusWindow) { if (!focusWindow)
root.close()
return return
}
if (root.keepOpen) if (root.keepOpen)
return return