Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 Support (Qt 5) › Add combobox to form with TextFieldRows

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #24165

    Medrepo

    Hi,

    I have an input form and TextFieldRow component fits perfectly into it, but I didn’t find any way to replace TextField with Combo for some fields. Is it possible? If I place combo after Repeater, like in snippet below, it looks shifted having its own padding and other alignment parameters:

        Column {
            width: parent.width
    
            Repeater {
                model: Object.keys(profileData)
                TextFieldRow {
                    label: modelData.replace("_", " ")
                    textItem.wrapMode: Text.NoWrap
                    textItem.font.capitalization: Font.Capitalize
                    textFieldItem.readOnly: Object.keys(profileData)[index] === "email"
                    textFieldItem.inputMethodHints: Qt.ImhNoPredictiveText
                    textFieldItem.inputMode: modelData === "password"?AppTextField.inputModePassword:(modelData === "email"?AppTextField.inputModeEmail:AppTextField.inputModeDefault)
                    visible: modelData !== "id"
                    value: profileData[modelData]
                    textFieldItem.onAccepted: {
                        logic.storeProfileData(profileId, Object.keys(profileData)[index], text)
                        page.forceActiveFocus()
                    }
                }
            }
            // sex is a combobox
            Row {
                AppText {
                    wrapMode: Text.NoWrap
                    text: qsTr("Sex")
                }
                ComboBox {
                    model: [qsTr("Not known"), qsTr("Male"), qsTr("Female")]
                    currentIndex: profileData["sex"]
                    onActivated: {
                        logic.storeProfileData(profileId, "sex", currentIndex)
                        page.forceActiveFocus()
                    }
                }
            }
        }

    Setting input mode of the text field gives an error “Unable to assign [undefined] to int”. What namespace should I use for input modes?

     

    #24168

    Bence
    Felgo Team

    Hi,

    TextFieldRow cannot be used without a TextField. You might want to try using AppListItem which can be extensively configured and could fit your use case: https://felgo.com/doc/felgo-applistitem/

    Best,

    Bence

Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded