Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to get Intput from TextInput upon pressing the done button on Android keyborad.[solved]
Forum Updated to NodeBB v4.3 + New Features

How to get Intput from TextInput upon pressing the done button on Android keyborad.[solved]

Scheduled Pinned Locked Moved QML and Qt Quick
16 Posts 2 Posters 4.1k Views 2 Watching
  • 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.
  • p3c0P p3c0

    @vishnucool220 Thank You :)
    Well does it work on desktop ?

    vishnuV Offline
    vishnuV Offline
    vishnu
    wrote on last edited by
    #6

    @p3c0
    yes. But code works perfect it is sending the data which is in the limit. If i put a value which is not validated it is not sending.No problem at the backend . Only problem is for the user. The user might think it is valid number.How can i restrict him not to give invalid input? Thanks

    p3c0P 1 Reply Last reply
    0
    • vishnuV vishnu

      @p3c0
      yes. But code works perfect it is sending the data which is in the limit. If i put a value which is not validated it is not sending.No problem at the backend . Only problem is for the user. The user might think it is valid number.How can i restrict him not to give invalid input? Thanks

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #7

      @vishnucool220 Did you try setting inputMethodHints as said earlier ?

      157

      vishnuV 1 Reply Last reply
      0
      • p3c0P p3c0

        @vishnucool220 Did you try setting inputMethodHints as said earlier ?

        vishnuV Offline
        vishnuV Offline
        vishnu
        wrote on last edited by
        #8

        @p3c0
        inputMethodHints: Qt.ImhDigitsOnly work perfect. Now i accepts only digits. But the user can give me than the range specified in the validator. not working both on windows and android.

        p3c0P 1 Reply Last reply
        0
        • vishnuV vishnu

          @p3c0
          inputMethodHints: Qt.ImhDigitsOnly work perfect. Now i accepts only digits. But the user can give me than the range specified in the validator. not working both on windows and android.

          p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #9

          @vishnucool220 And what is that range ?

          157

          vishnuV 1 Reply Last reply
          0
          • p3c0P p3c0

            @vishnucool220 And what is that range ?

            vishnuV Offline
            vishnuV Offline
            vishnu
            wrote on last edited by
            #10

            @p3c0
            inputvalidate: DoubleValidator{bottom: -1500;top: 1500;decimals: 1000}

            p3c0P 1 Reply Last reply
            0
            • vishnuV vishnu

              @p3c0
              inputvalidate: DoubleValidator{bottom: -1500;top: 1500;decimals: 1000}

              p3c0P Offline
              p3c0P Offline
              p3c0
              Moderators
              wrote on last edited by
              #11

              @vishnu try changing notation property to StandardNotation

              157

              vishnuV 1 Reply Last reply
              0
              • p3c0P p3c0

                @vishnu try changing notation property to StandardNotation

                vishnuV Offline
                vishnuV Offline
                vishnu
                wrote on last edited by
                #12

                @p3c0
                perfect but the problem is it accepting till 4 digits. i.e Even though my top value :1500 .user can put till 9999.Any solution ?

                p3c0P 1 Reply Last reply
                0
                • vishnuV vishnu

                  @p3c0
                  perfect but the problem is it accepting till 4 digits. i.e Even though my top value :1500 .user can put till 9999.Any solution ?

                  p3c0P Offline
                  p3c0P Offline
                  p3c0
                  Moderators
                  wrote on last edited by
                  #13

                  @vishnu Hmm that is expected behavior. From the docs:

                  Input is accepected but invalid if it contains a double that is outside the range or is in the wrong format; e.g. with too many digits after the decimal point or is empty.

                  In this case use the accepted signal to check the validity of the input. It won't trigger if the number is not in that range.

                  TextInput{
                      validator: DoubleValidator { bottom: -1500; top: 1500; decimals: 1000;
                          notation: DoubleValidator.StandardNotation
                      }
                      onAccepted: console.log("Accepted") //won't trigger if not input not valid
                  }
                  

                  157

                  vishnuV 1 Reply Last reply
                  1
                  • p3c0P p3c0

                    @vishnu Hmm that is expected behavior. From the docs:

                    Input is accepected but invalid if it contains a double that is outside the range or is in the wrong format; e.g. with too many digits after the decimal point or is empty.

                    In this case use the accepted signal to check the validity of the input. It won't trigger if the number is not in that range.

                    TextInput{
                        validator: DoubleValidator { bottom: -1500; top: 1500; decimals: 1000;
                            notation: DoubleValidator.StandardNotation
                        }
                        onAccepted: console.log("Accepted") //won't trigger if not input not valid
                    }
                    
                    vishnuV Offline
                    vishnuV Offline
                    vishnu
                    wrote on last edited by
                    #14

                    @p3c0
                    Perfect. Instead on poping up new thread .I want to ask here itself. when ever i press on the TextInput Box on Android . These were shown on the application output. What does it mean ? Is something wrong ?
                    W/IInputConnectionWrapper( 7920): beginBatchEdit on inactive InputConnection
                    W/IInputConnectionWrapper( 7920): endBatchEdit on inactive InputConnection
                    W/IInputConnectionWrapper( 7920): showStatusIcon on inactive InputConnection
                    W/IInputConnectionWrapper( 7920): beginBatchEdit on inactive InputConnection
                    W/IInputConnectionWrapper( 7920): endBatchEdit on inactive InputConnection
                    W/IInputConnectionWrapper( 7920): beginBatchEdit on inactive InputConnection
                    W/IInputConnectionWrapper( 7920): endBatchEdit on inactive InputConnection

                    p3c0P 1 Reply Last reply
                    0
                    • vishnuV vishnu

                      @p3c0
                      Perfect. Instead on poping up new thread .I want to ask here itself. when ever i press on the TextInput Box on Android . These were shown on the application output. What does it mean ? Is something wrong ?
                      W/IInputConnectionWrapper( 7920): beginBatchEdit on inactive InputConnection
                      W/IInputConnectionWrapper( 7920): endBatchEdit on inactive InputConnection
                      W/IInputConnectionWrapper( 7920): showStatusIcon on inactive InputConnection
                      W/IInputConnectionWrapper( 7920): beginBatchEdit on inactive InputConnection
                      W/IInputConnectionWrapper( 7920): endBatchEdit on inactive InputConnection
                      W/IInputConnectionWrapper( 7920): beginBatchEdit on inactive InputConnection
                      W/IInputConnectionWrapper( 7920): endBatchEdit on inactive InputConnection

                      p3c0P Offline
                      p3c0P Offline
                      p3c0
                      Moderators
                      wrote on last edited by
                      #15

                      @vishnu No. I guess they are debug messages from functions in android's apis.

                      157

                      vishnuV 1 Reply Last reply
                      0
                      • p3c0P p3c0

                        @vishnu No. I guess they are debug messages from functions in android's apis.

                        vishnuV Offline
                        vishnuV Offline
                        vishnu
                        wrote on last edited by
                        #16

                        @p3c0
                        Okay.

                        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