Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    qregexpvalidator doesn't work in Android

    Mobile and Embedded
    android androidqt android 2.3.3 qt5.4
    2
    7
    1424
    Loading More Posts
    • 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.
    • Buleron
      Buleron last edited by Buleron

      QRegExpValidator* validator = new QRegExpValidator(QRegExp("[A-a-Z-z][A-a-Z-z]\\d{0,2}\\d[0-9-A-a-Z-z][A-a-Z-z]"));
      ui->lineEdit->setValidator(validator);

      it wokrs in windows but not in android

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        Did you try with QRegularExpressionValidator ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • Buleron
          Buleron last edited by

          Hi @SGaist thanks for reply
          I just try with QRegularExpressionValidator but same problem it doesn't work

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            What exactly doesn't work ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply Reply Quote 0
            • Buleron
              Buleron last edited by Buleron

              this work correctly in windows , but when i deploy in android it doesnt
              ui->lineEdit->setMaxLength(7);
              QRegularExpressionValidator* valid = new QRegularExpressionValidator(QRegularExpression("[A-a-Z-z][A-a-Z-z]\\d{0,2}\\d[0-9-A-a-Z-z][A-a-Z-z]"));
              ui->lineEdit->setValidator(valid);

              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                Can you please describe precisely what doesn't work ? Is the input blocked ? Not validated ? etc.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply Reply Quote 0
                • Buleron
                  Buleron last edited by

                  yes the input isn't blocked , it not validated!

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post