diff --git a/example/qml/component/CodeExpander.qml b/example/qml/component/CodeExpander.qml index f66614b8..88deb7bc 100644 --- a/example/qml/component/CodeExpander.qml +++ b/example/qml/component/CodeExpander.qml @@ -16,7 +16,7 @@ FluExpander{ id:content width:parent.width text:highlightQmlCode(code) - textFormat: FluMultilineTextBox.RichText + textFormat: FluCopyableText.RichText padding: 10 topPadding: 10 leftPadding: 10 diff --git a/src/Qt5/imports/FluentUI/Controls/FluCopyableText.qml b/src/Qt5/imports/FluentUI/Controls/FluCopyableText.qml index d5f2cbb6..6d0866c5 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluCopyableText.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluCopyableText.qml @@ -33,14 +33,14 @@ TextEdit { function popup(){ sourceComponent = menu } - onLoaded: { - item.open() - } } Component{ id:menu FluTextBoxMenu{ inputItem: control + Component.onCompleted: { + popup() + } onClosed: { menu_loader.sourceComponent = undefined } diff --git a/src/Qt5/imports/FluentUI/Controls/FluMultilineTextBox.qml b/src/Qt5/imports/FluentUI/Controls/FluMultilineTextBox.qml index 70180fc2..5febd258 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluMultilineTextBox.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluMultilineTextBox.qml @@ -79,12 +79,12 @@ TextArea{ function popup(){ sourceComponent = menu } - onLoaded: { - item.open() - } } Component{ id:menu + Component.onCompleted: { + popup() + } FluTextBoxMenu{ inputItem: control onClosed: { diff --git a/src/Qt5/imports/FluentUI/Controls/FluTextBox.qml b/src/Qt5/imports/FluentUI/Controls/FluTextBox.qml index 16510084..ca8ebb59 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluTextBox.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluTextBox.qml @@ -116,14 +116,14 @@ TextField{ function popup(){ sourceComponent = menu } - onLoaded: { - item.open() - } } Component{ id:menu FluTextBoxMenu{ inputItem: control + Component.onCompleted: { + popup() + } onClosed: { menu_loader.sourceComponent = undefined } diff --git a/src/Qt6/imports/FluentUI/Controls/FluCopyableText.qml b/src/Qt6/imports/FluentUI/Controls/FluCopyableText.qml index 2437d4e0..34d4368c 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluCopyableText.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluCopyableText.qml @@ -33,14 +33,14 @@ TextEdit { function popup(){ sourceComponent = menu } - onLoaded: { - item.open() - } } Component{ id:menu FluTextBoxMenu{ inputItem: control + Component.onCompleted: { + popup() + } onClosed: { menu_loader.sourceComponent = undefined } diff --git a/src/Qt6/imports/FluentUI/Controls/FluMultilineTextBox.qml b/src/Qt6/imports/FluentUI/Controls/FluMultilineTextBox.qml index a893e7dc..a6af01d8 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluMultilineTextBox.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluMultilineTextBox.qml @@ -72,11 +72,25 @@ TextArea{ if(control.readOnly && control.text === ""){ return } - menu.popup() + menu_loader.popup() } } - FluTextBoxMenu{ + FluLoader{ + id: menu_loader + function popup(){ + sourceComponent = menu + } + } + Component{ id:menu - inputItem: control + Component.onCompleted: { + popup() + } + FluTextBoxMenu{ + inputItem: control + onClosed: { + menu_loader.sourceComponent = undefined + } + } } } diff --git a/src/Qt6/imports/FluentUI/Controls/FluTextBox.qml b/src/Qt6/imports/FluentUI/Controls/FluTextBox.qml index e48a5417..0ed64310 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluTextBox.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluTextBox.qml @@ -117,14 +117,14 @@ TextField{ function popup(){ sourceComponent = menu } - onLoaded: { - item.open() - } } Component{ id:menu FluTextBoxMenu{ inputItem: control + Component.onCompleted: { + popup() + } onClosed: { menu_loader.sourceComponent = undefined }