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

Fuzzy hit test returns incorrect cursor position in QTextDocument's layout.

    XMLWordPrintable

Details

    Description

      STEPS LEADING TO PROBLEM:
      Attached a test application which basically does the following:
      1. Create QTextDocument
      2. Add multiple lines of text, separated by LF (\n)
      3. Use QTextDocument::documentLayout()->hitTest(pos, Qt::FuzzyHit) to find
      cursor position in different y coordinate values. Let x be constant 1.

      EXPECTED OUTCOME:
      Returned cursor position should indicate place close to actual hit point.

      ACTUAL OUTCOME:
      With a hitpoint in between lines the returned cursor is at the end of row, even
      if x coordinate would be at the beginning of row (e.g. x=0.0).

      In practise this behaviour can be seen in touch screen device so that even if user moves finger vertically in left edge of left-aligned text edit, cursor sometimes jumps to right side, in the end of row. Also by tapping just in the middle between lines(doesn't matter what x coordinate is) causes cursor to appear at the right side of the text.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            jupakari Juuso Pakarinen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes