From b5f44f4f7d383e382c73d300e66207e372e7b61f Mon Sep 17 00:00:00 2001 From: zhuzihcu Date: Thu, 30 Mar 2023 18:34:03 +0800 Subject: [PATCH] update --- example/page/LoginPage.qml | 4 ++-- src/controls/FluAutoSuggestBox.qml | 9 +++++++-- src/controls/FluMultiLineTextBox.qml | 2 +- src/controls/FluTextBox.qml | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/example/page/LoginPage.qml b/example/page/LoginPage.qml index 5f000ebe..03d7b786 100644 --- a/example/page/LoginPage.qml +++ b/example/page/LoginPage.qml @@ -17,7 +17,7 @@ FluWindow { onInitArgument: (argument)=>{ - textbox_uesrname.text = argument.username + textbox_uesrname.updateText(argument.username) textbox_password.focus = true } @@ -35,7 +35,7 @@ FluWindow { FluAutoSuggestBox{ id:textbox_uesrname - values:["Admin","User"] + items:[{title:"Admin"},{title:"User"}] placeholderText: "请输入账号" Layout.preferredWidth: 260 Layout.alignment: Qt.AlignHCenter diff --git a/src/controls/FluAutoSuggestBox.qml b/src/controls/FluAutoSuggestBox.qml index 6d783867..8160d548 100644 --- a/src/controls/FluAutoSuggestBox.qml +++ b/src/controls/FluAutoSuggestBox.qml @@ -225,8 +225,12 @@ TextField{ function handleClick(modelData){ input_popup.visible = false input.itemClicked(modelData) + updateText(modelData.title) + } + + function updateText(text){ d.flagVisible = false - input.text = modelData.title + input.text = text d.flagVisible = true } @@ -239,8 +243,9 @@ TextField{ TapHandler { acceptedButtons: Qt.RightButton - onTapped: menu.popup() + onTapped: input.echoMode !== TextInput.Password && menu.popup() } + FluMenu{ id:menu focus: false diff --git a/src/controls/FluMultiLineTextBox.qml b/src/controls/FluMultiLineTextBox.qml index 6f6e6a9b..ea3b5b71 100644 --- a/src/controls/FluMultiLineTextBox.qml +++ b/src/controls/FluMultiLineTextBox.qml @@ -75,7 +75,7 @@ TextArea{ } TapHandler { acceptedButtons: Qt.RightButton - onTapped: menu.popup() + onTapped: input.echoMode !== TextInput.Password && menu.popup() } FluMenu{ id:menu diff --git a/src/controls/FluTextBox.qml b/src/controls/FluTextBox.qml index 3915f679..f84715a3 100644 --- a/src/controls/FluTextBox.qml +++ b/src/controls/FluTextBox.qml @@ -74,7 +74,7 @@ TextField{ } TapHandler { acceptedButtons: Qt.RightButton - onTapped: menu.popup() + onTapped: input.echoMode !== TextInput.Password && menu.popup() } FluMenu{ id:menu