main
zhuzihcu 2023-03-30 18:34:03 +08:00
parent cbd4c229aa
commit b5f44f4f7d
4 changed files with 11 additions and 6 deletions

View File

@ -17,7 +17,7 @@ FluWindow {
onInitArgument: onInitArgument:
(argument)=>{ (argument)=>{
textbox_uesrname.text = argument.username textbox_uesrname.updateText(argument.username)
textbox_password.focus = true textbox_password.focus = true
} }
@ -35,7 +35,7 @@ FluWindow {
FluAutoSuggestBox{ FluAutoSuggestBox{
id:textbox_uesrname id:textbox_uesrname
values:["Admin","User"] items:[{title:"Admin"},{title:"User"}]
placeholderText: "请输入账号" placeholderText: "请输入账号"
Layout.preferredWidth: 260 Layout.preferredWidth: 260
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter

View File

@ -225,8 +225,12 @@ TextField{
function handleClick(modelData){ function handleClick(modelData){
input_popup.visible = false input_popup.visible = false
input.itemClicked(modelData) input.itemClicked(modelData)
updateText(modelData.title)
}
function updateText(text){
d.flagVisible = false d.flagVisible = false
input.text = modelData.title input.text = text
d.flagVisible = true d.flagVisible = true
} }
@ -239,8 +243,9 @@ TextField{
TapHandler { TapHandler {
acceptedButtons: Qt.RightButton acceptedButtons: Qt.RightButton
onTapped: menu.popup() onTapped: input.echoMode !== TextInput.Password && menu.popup()
} }
FluMenu{ FluMenu{
id:menu id:menu
focus: false focus: false

View File

@ -75,7 +75,7 @@ TextArea{
} }
TapHandler { TapHandler {
acceptedButtons: Qt.RightButton acceptedButtons: Qt.RightButton
onTapped: menu.popup() onTapped: input.echoMode !== TextInput.Password && menu.popup()
} }
FluMenu{ FluMenu{
id:menu id:menu

View File

@ -74,7 +74,7 @@ TextField{
} }
TapHandler { TapHandler {
acceptedButtons: Qt.RightButton acceptedButtons: Qt.RightButton
onTapped: menu.popup() onTapped: input.echoMode !== TextInput.Password && menu.popup()
} }
FluMenu{ FluMenu{
id:menu id:menu