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

QTextCursor::movePosition() with NextCursor/PreviousCursor has no effect if anchor != position

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Not Evaluated
    • 4.7.1
    • 4.5.0
    • GUI: Text handling
    • None

    Description

      In Qt 4.4 and below, this code can be used to move a QTextCursor one place to the left or right in a QTextDocument:

      cursor.movePosition(QTextCursor::NextCharacter,QTextCursor::MoveAnchor,1)

      In Qt 4.5 RC 1 this has no effect if the cursor's anchor and position were different prior to calling movePosition()

      This is a result of the fix for task 103115: http://labs.trolltech.com/gitweb?p=qt/snapshot/4.5;a=commitdiff;h=863c336c4f77549a7cd3eca6cbb8e787741151c5#patch80

      The fix makes sense from a QTextEdit user's point of view but it breaks the semantics of NextCharacter/PreviousCharacter for programmers using QTextCursor::movePosition() and makes them different from NextWord/PreviousWord.

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            janichol Andy Nichols
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes