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

Forums

OverviewFelgo 3 Support (Qt 5) › weird behavior on AppTextField

Tagged: 

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

    jrrobles79

    I have this small component that is in a popup this apptexfield is to capture a sms code:

     

    
            InputField {
                id: tfSMSCode
                 property bool valid: tfSMSCode.text.length === 6
                width: parent.width
                placeholderText: qsTr("_ _ _ _ _ _")
                anchors.horizontalCenter: parent.horizontalCenter
                font.pixelSize: sp(15)
                font.bold: true
                horizontalAlignment: Text.AlignHCenter
                validator: RegExpValidator {
                    regExp: /^\d{1,6}$/
                }
            }
    
            YellowButton {
                id: btnVerifySMSCode
                minimumWidth: parent.width
                minimumHeight: dp(50)
                text: qsTr("Verificar")
                enabled: tfSMSCode.valid
                anchors.horizontalCenter: parent.horizontalCenter
                 onClicked: {
                     btnVerifyClicked(tfSMSCode.text)
                     close()
                 }
    
            }

     

    the problem is that on some android devices the property  ‘property bool valid: tfSMSCode.text.length === 6' is not working, unless the

    user ‘move’ manually the cursor on the input code on textfield to the start:

    from:

    12345 6

    to

    1 23456

    is this qml bug? and why does happen only on some devices, I will add some screenshots that my tester has pass me.

     

    https://www.dropbox.com/s/i6ygpbi8df883ew/disabled.png?dl=0

    https://www.dropbox.com/s/ltf7cnme9nfizy8/enabled.png?dl=0

     

    This is givin the impression that the app is not working since you can’t do anything as you input the sms code but the button isn’t setting the enable property to true

     

     

    #23584

    Alex
    Felgo Team

    Hi,

    if input composing (like dictionary) features are active at the keyboard, you need to use the displayText property instead, as the text property does not contain the currently composed word word until it is accepted.

    You can also set the inputMethodsHints of the text field to Qt.ImhSensitiveData to disallow any composing methods.

    Best,
    Alex

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