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

Details

    Description

      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));
                  }
              }
          }
      }
      

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes