Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-112530

selectedText from TextInput is blank

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 6.5.0 RC
    • Quick: Controls 2
    • None

    Description

      I am trying to get the selected text I have selected using either a mouse or a keyboard. I was printing it to a Text, but it was blank, so I decided to print it to the console and then it was returning blank string. So I checked the length of the string and it came out to be zero.

      What did I expect to happen:

      • I was expecting it to hold the the selected text that I have selected in the TextInput using a mouse and/or a keyboard.

      What happens instead

      • It returns blank. I checked the length of the returned string and it was 0.

      [Edit] - It appears that the selectedText is based on the selectionStart and selectionEnd properties. These properties I have just found out, are actually returning the same value, which is the value of selectionEnd. So any attempt to use them to get the selected text fails, becuase selectionStart returns selectionEnd, and there is no way to get selectionStart to work with.

      In the attached file, I have included some amount of code, which is 90% the code I was working on. This is because, textInput doesn't draw a background and there is a button that prints the selection to the control.

      Attachments

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            amohampofo Godwin Amoh - Gyebi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: