Forums

OverviewFelgo 2 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.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support