Qt Forum

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

    Update: Forum Guidelines & Code of Conduct

    [Solved]How to select char left from cursor in TextInput?

    QML and Qt Quick
    textinput
    2
    9
    1790
    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.
    • Z
      Zubalama last edited by p3c0

      I want to select 1 character left from cursor in textInput, how can I do that?

      p3c0 1 Reply Last reply Reply Quote 0
      • p3c0
        p3c0 Moderators @Zubalama last edited by

        @Zubalama Try this:

        inpuT.getText(inpuT.length-1,inpuT.length)
        ///inpuT = id of TextInput.
        

        157

        1 Reply Last reply Reply Quote 0
        • Z
          Zubalama last edited by

          @Zubalama said:

          select 1 character left from cursor in textInput

          input.text=input.text-input.getText(input.length-1,input.length) why it returns "nan"? just nan?

          p3c0 1 Reply Last reply Reply Quote 0
          • p3c0
            p3c0 Moderators @Zubalama last edited by

            @Zubalama Why are you subtracting text again from it ?
            Just inpuT.getText(inpuT.length-1,inpuT.length) should work.

            157

            1 Reply Last reply Reply Quote 0
            • Z
              Zubalama last edited by

              because I'm trying to make backspace button, and onClick won't work because I'm trying to do it for remote control

              p3c0 1 Reply Last reply Reply Quote 0
              • p3c0
                p3c0 Moderators @Zubalama last edited by

                @Zubalama Then you need remove instead of getText.

                157

                Z 1 Reply Last reply Reply Quote 1
                • Z
                  Zubalama @p3c0 last edited by

                  @p3c0 thank you I love you for that, respect and I mean you are the greatest man I've ever heard of =)) thank you again

                  1 Reply Last reply Reply Quote 0
                  • Z
                    Zubalama last edited by Zubalama

                    1 more question how do I make topic "solved"?

                    p3c0 1 Reply Last reply Reply Quote 0
                    • p3c0
                      p3c0 Moderators @Zubalama last edited by

                      @Zubalama There's a Topic Tools box at the bottom. Inside it contains Mark Solved option. If it doesn't work then edit the post title and prepend [Solved]. If you don't get it, let us know.

                      157

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