kde-framework
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
From 4f01e2ff676cd4a11ba36f49d967db4635e2d216 Mon Sep 17 00:00:00 2001
|
||||
From: Nicolas Fella <nicolas.fella@gmx.de>
|
||||
Date: Wed, 6 Mar 2024 19:39:09 +0100
|
||||
Subject: [PATCH] [qtquick/action] Add API to set transient parent for dialog
|
||||
|
||||
We want the dialog to have a proper parent window set. Usually
|
||||
Qt automatically obtains one from the parent item. This doesn't
|
||||
work here however since the dialog's loader is not part of the item
|
||||
hierarchy. This causes the window to not be shown since Qt 6.7.
|
||||
|
||||
See QTBUG-121197
|
||||
|
||||
Merely adding the property and setting it to null makes sure the
|
||||
window can be shown. Users of the API should however pass a parent window
|
||||
so that the dialog has a parent set.
|
||||
|
||||
BUG: 479816
|
||||
---
|
||||
src/qtquick/qml/Action.qml | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/src/qtquick/qml/Action.qml b/src/qtquick/qml/Action.qml
|
||||
index ae134112e..05e49d6ab 100644
|
||||
--- a/src/qtquick/qml/Action.qml
|
||||
+++ b/src/qtquick/qml/Action.qml
|
||||
@@ -92,6 +92,14 @@ Kirigami.Action {
|
||||
*/
|
||||
property bool visibleWhenDisabled: false
|
||||
|
||||
+ /**
|
||||
+ * The parent window for the dialog created by invoking the action
|
||||
+ *
|
||||
+ * @since 6.1
|
||||
+ *
|
||||
+ */
|
||||
+ property var transientParent: null
|
||||
+
|
||||
/**
|
||||
* Show the page/dialog (same as activating the action), if allowed by the Kiosk settings
|
||||
*/
|
||||
@@ -185,6 +193,7 @@ Kirigami.Action {
|
||||
asynchronous: true
|
||||
|
||||
sourceComponent: NewStuff.Dialog {
|
||||
+ transientParent: component.transientParent
|
||||
configFile: component.configFile
|
||||
viewMode: component.viewMode
|
||||
}
|
||||
--
|
||||
GitLab
|
||||
|
||||
Reference in New Issue
Block a user