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

QTextDocument::markContentsDirty Causes Loss of contentsChange Signals

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.8
    • GUI: Text handling
    • None
    • All

    Description

      If markContentsDirty is invoked on a document while an edit block is in progress (I ran into this scenario by calling rehighlight() on a QSyntaxHighligher), any slots connected to the document's contentsChange signal are not informed about changes that happened prior to the call.

      See the attached reproduction project. It adds 3 characters, forces a re-highlight, and then adds another 3 characters.

      If commenting out the highligher.rehighlightBlock call, we get:

      Added 6 characters from 0 

      If not, we get:

      Added 3 characters from 3 

      Which is wrong. I'd expect the slot to be invoked with all the changes, though perhaps more than once.

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            igkh Igor Khanin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes