Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QML RegularExpressionValidator not working on android

QML RegularExpressionValidator not working on android

Scheduled Pinned Locked Moved Solved Mobile and Embedded
6 Posts 3 Posters 548 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mihaill
    wrote on last edited by
    #1

    Hi !
    QML RegularExpressionValidator and IntValidator not working on android.
    But it is work for Linux. How I can fix this?

            TextField {
    //            TextInput {
    //            validator: IntValidator {bottom: 1; top: 999999999}
                validator: RegularExpressionValidator { regularExpression: /[0-9]+/ }
    
            }
    
    KroMignonK 2 Replies Last reply
    0
    • M Mihaill

      Hi !
      QML RegularExpressionValidator and IntValidator not working on android.
      But it is work for Linux. How I can fix this?

              TextField {
      //            TextInput {
      //            validator: IntValidator {bottom: 1; top: 999999999}
                  validator: RegularExpressionValidator { regularExpression: /[0-9]+/ }
      
              }
      
      KroMignonK Offline
      KroMignonK Offline
      KroMignon
      wrote on last edited by
      #2

      @Mihaill Hello which Qt version are you using? Do you use same Qt version for Linux and Android?

      It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

      1 Reply Last reply
      0
      • M Mihaill

        Hi !
        QML RegularExpressionValidator and IntValidator not working on android.
        But it is work for Linux. How I can fix this?

                TextField {
        //            TextInput {
        //            validator: IntValidator {bottom: 1; top: 999999999}
                    validator: RegularExpressionValidator { regularExpression: /[0-9]+/ }
        
                }
        
        KroMignonK Offline
        KroMignonK Offline
        KroMignon
        wrote on last edited by
        #3

        @Mihaill said in QML RegularExpressionValidator not working on android:

        QML RegularExpressionValidator and IntValidator not working on android.
        But it is work for Linux. How I can fix this?

        I think you have to remove "text prediction" to made it works on Android, following should work:

        TextField {
            validator: RegularExpressionValidator { regularExpression: /[0-9]+/ }
            inputMethodHints: Qt.ImhNoPredictiveText
        }
        

        It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Mihaill
          wrote on last edited by
          #4

          @KroMignon said in QML RegularExpressionValidator not working on android:

          TextField {
          validator: RegularExpressionValidator { regularExpression: /[0-9]+/ }
          inputMethodHints: Qt.ImhNoPredictiveText
          }

          It is not work for android. I use Qt 6.2.2

          1 Reply Last reply
          0
          • M Offline
            M Offline
            morte
            wrote on last edited by
            #5

            Is that what you need?

            inputMethodHints: Qt.ImhDigitsOnly
            
            1 Reply Last reply
            0
            • M Offline
              M Offline
              Mihaill
              wrote on last edited by Mihaill
              #6

              @morte said in QML RegularExpressionValidator not working on android:

              inputMethodHints: Qt.ImhDigitsOnly

              It is not works for Ubuntu, but works for Android

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved