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

Crash in QTextCursorPrivate::setX() when using QTextCursor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.8.3
    • 4.8.0
    • GUI: Text handling
    • None
    • Debian linux, but not really relevant, when looking at the code.
    • ebfbabf1f3c2e65acecdb06de3b3a47a933e38f9

    Description

      When changing the position of a QTextCursor through editing or just setPosition or movePosition, and the position is in a not-yet-relayouted block then Qt crashes. This is new in 4.8.0

      There is a check in QTextCursorPrivate::setX() for editBlock and when I put that around it doesn't crash, however that is not a practical workaround for other reasons. Looks like there is also a check if the line is valid so it is actually weird tat doesn't prevent the crash. Maybe the lines are not invalidated when edited. Well at least some qt 4.8.0 change made it happen

      In Caligra we have our own documentlayout class that obviously can't layout everything on every change so we have timers to do it a little of a time. I would assume the crash would happen too if no documentlayout class is attached (QTextDocument acting like just a storage)

      Attachments

        1. main.cpp
          0.6 kB
        2. MyTextEdit.h
          0.5 kB

        Activity

          People

            jiang Jiang Jiang
            boemann C. Boemann
            Votes:
            5 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: