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

QTextDocument::markContentsDirty Causes Loss of contentsChange Signals

XMLWordPrintable

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

      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.

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

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

              Created:
              Updated:

                There are no open Gerrit changes