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

TextInput selectWord() on word's first letter often selects two words

    XMLWordPrintable

Details

    • 77cba04c244c47c77af04777de3b3172c309b541

    Description

      Double click on the first letter of any word, left of the letter's vertical center.
      This selects the word and the word infront.

      import Qt 4.7
      
      Item
      {
          width: 600
          height: 400
      
          Rectangle {
              width: 400
              height: 40
              color: "lightgreen"
              anchors.centerIn: parent
      
              TextInput {
                  id: textInput
                  anchors.fill: parent
                  text: "This is a TextInput text"
                  font.pixelSize: 30
                  selectByMouse: true
      
                  MouseArea {
                      anchors.fill: parent
                      onPressed: {
                          print("pressed")
                          textInput.focus = true;
                          textInput.cursorPosition = textInput.positionAt(mouse.x);
                      }
      
                      onDoubleClicked: {
                          print("double-clicked")
                          textInput.selectWord(textInput.positionAt(mouse.x));
                      }
                  }
              }
          }
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            dajansen Damian Jansen (closed Nokia identity) (Inactive)
            mathiasm Mathias Malmqvist
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes