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

QTextEdit::cursorForPosition(QPoint(0, 0)) may return inorrect QTextCursor when text edit's text document has not been laid out

    XMLWordPrintable

Details

    Description

      Calling QTextEdit::cursorForPosition(QPoint(0, 0)) may return a QTextCursor with an incorrect block(), when the text edit's text document has not been laid out yet. It seems like the text document layout's internal hitTest() function returns incorrect results, when the point is (0, 0). After the text edit's text document has been laid out, the QTextCursor's block() is correct.

      Calling cursorForPosition(QPoint(0, 1)) works correctly, even though the text edit's text document has not been laid out, so cursorForPosition(QPoint(0, 0)) should also work.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            sthomass Stian Sandvik Thomassen (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes