diff --git a/src/Qt5/imports/FluentUI/Controls/FluWindowDialog.qml b/src/Qt5/imports/FluentUI/Controls/FluWindowDialog.qml index 0e14060d..78f54bda 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluWindowDialog.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluWindowDialog.qml @@ -9,11 +9,19 @@ FluWindow { property Component contentDelegate autoVisible: false autoCenter: false - autoDestory: false + autoDestory: true fixSize: true Loader{ anchors.fill: parent - sourceComponent: control.visible ? control.contentDelegate : undefined + sourceComponent: { + if(control.autoDestory){ + return control.visible ? control.contentDelegate : undefined + } + return control.contentDelegate + } + } + closeListener: function(event){ + event.accepted = true } function showDialog(){ var x = transientParent.x + (transientParent.width - width)/2 diff --git a/src/Qt6/imports/FluentUI/Controls/FluWindowDialog.qml b/src/Qt6/imports/FluentUI/Controls/FluWindowDialog.qml index ff524536..a5f03a7c 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluWindowDialog.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluWindowDialog.qml @@ -9,11 +9,19 @@ FluWindow { property Component contentDelegate autoVisible: false autoCenter: false - autoDestory: false + autoDestory: true fixSize: true Loader{ anchors.fill: parent - sourceComponent: control.visible ? control.contentDelegate : undefined + sourceComponent: { + if(control.autoDestory){ + return control.visible ? control.contentDelegate : undefined + } + return control.contentDelegate + } + } + closeListener: function(event){ + event.accepted = true } function showDialog(){ var x = transientParent.x + (transientParent.width - width)/2