From d767bfde4dbecc58cc076bb87f1421f751ebe1fb Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Mon, 13 May 2024 15:36:03 +0200 Subject: [PATCH] QmlDesigner: Fix Connection editor closing Task-number: QDS-12013 Change-Id: I8add3418bb43b87e45153c012353646833413664 Reviewed-by: Thomas Hartmann (cherry picked from commit e86814c491e7d9997cf53cbf2c13e7f6e14fac5c) Reviewed-by: Qt Cherry-pick Bot --- .../connectionseditor/ConnectionsDialog.qml | 4 ++++ .../connectionseditor/ConnectionsDialogForm.qml | 17 +++++++++-------- .../imports/StudioControls/PopupDialog.qml | 6 ++---- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/share/qtcreator/qmldesigner/connectionseditor/ConnectionsDialog.qml b/share/qtcreator/qmldesigner/connectionseditor/ConnectionsDialog.qml index 965f31d21ab..299234127ad 100644 --- a/share/qtcreator/qmldesigner/connectionseditor/ConnectionsDialog.qml +++ b/share/qtcreator/qmldesigner/connectionseditor/ConnectionsDialog.qml @@ -11,6 +11,8 @@ StudioControls.PopupDialog { property alias backend: form.backend + keepOpen: form.keepOpen + titleBar: Row { spacing: 30 // TODO anchors.fill: parent @@ -43,6 +45,8 @@ StudioControls.PopupDialog { ConnectionsDialogForm { id: form + parentWindow: root.window + Connections { target: root.backend function onPopupShouldClose() { diff --git a/share/qtcreator/qmldesigner/connectionseditor/ConnectionsDialogForm.qml b/share/qtcreator/qmldesigner/connectionseditor/ConnectionsDialogForm.qml index 603903dbdd2..a799165375f 100644 --- a/share/qtcreator/qmldesigner/connectionseditor/ConnectionsDialogForm.qml +++ b/share/qtcreator/qmldesigner/connectionseditor/ConnectionsDialogForm.qml @@ -16,6 +16,9 @@ Column { property var backend + property bool keepOpen: expressionDialogLoader.visible + property Window parentWindow: null + width: parent.width spacing: root.verticalSpacing @@ -267,10 +270,8 @@ Column { horizontalAlignment: code.lineCount === 1 ? Text.AlignHCenter : Text.AlignLeft verticalAlignment: Text.AlignVCenter elide: Text.ElideRight - } - Loader { id: expressionDialogLoader parent: editor @@ -297,19 +298,19 @@ Column { id: bindingEditor onRejected: { - hideWidget() + bindingEditor.hideWidget() expressionDialogLoader.visible = false } onAccepted: { backend.setNewSource(bindingEditor.text) - hideWidget() + bindingEditor.hideWidget() expressionDialogLoader.visible = false } } } - } // loader - } // rect - } //col 2 -}//col1 + } + } + } +} diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/PopupDialog.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/PopupDialog.qml index 40c35df27c7..821ba3a8491 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/PopupDialog.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/PopupDialog.qml @@ -104,7 +104,7 @@ QtObject { return root.maximumHeight + (2 * window.margin) } visible: false - flags: Qt.FramelessWindowHint | Qt.Tool | Qt.WindowStaysOnTopHint + flags: Qt.FramelessWindowHint | Qt.Tool color: "transparent" onClosing: function (close) { @@ -286,10 +286,8 @@ QtObject { enabled: root.visible function onFocusWindowChanged(focusWindow) { - if (!focusWindow) { - root.close() + if (!focusWindow) return - } if (root.keepOpen) return