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

TextInput's xToPosition() does not work when there's more text than fit in the field

XMLWordPrintable

      Run the code below and try to use the mouse to select a word from the end of the text.
      There does not appear to be any way of telling how much of the text has scrolled off
      the left edge.

      import Qt 4.7
      
      Rectangle {
          width: 640; height: 480;
          Rectangle {
              anchors.centerIn: parent
              width: 400; height: 25;
              color: "blue"
      
              TextInput {
                  anchors.fill: parent
                  color: "white"
                  focus: true
                  text: "Sea Shepherd campaigner Peter Bethune faces 15 years in jail after boarding whaling ship"
                  MouseArea {
                      anchors.fill: parent
                      onPressed: parent.cursorPosition = parent.xToPosition(mouse.x);
                      onPositionChanged: parent.moveCursorSelection(parent.xToPosition(mouse.x));
                  }
              }
          }
      }
      

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

            wallison Warwick Allison (closed Nokia identity) (Inactive)
            mathiasm Mathias Malmqvist
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes