Use markContentsDirty on the QTextDocument instead of the textWidth hack
This commit is contained in:
+3
-4
@@ -1037,10 +1037,9 @@ class GuiBuildNovelDocView(QTextBrowser):
|
|||||||
self.verticalScrollBar().setValue(sPos)
|
self.verticalScrollBar().setValue(sPos)
|
||||||
self._updateBuildAge()
|
self._updateBuildAge()
|
||||||
|
|
||||||
# This forces a repaint of the text, It's a hack to fix an occational
|
# Since we change the content while it may still be rendering, we mark
|
||||||
# issue where the find/replace above interfers with the rendering and
|
# the document dirty again to make sure it's re-rendered properly.
|
||||||
# leaves parts of the document blank.
|
self.qDocument.markContentsDirty(0, self.qDocument.characterCount())
|
||||||
self.qDocument.setTextWidth(self.qDocument.textWidth())
|
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
+3
-4
@@ -180,10 +180,9 @@ class GuiDocViewer(QTextBrowser):
|
|||||||
# Make sure the main GUI knows we changed the content
|
# Make sure the main GUI knows we changed the content
|
||||||
self.theParent.viewMeta.refreshReferences(tHandle)
|
self.theParent.viewMeta.refreshReferences(tHandle)
|
||||||
|
|
||||||
# This forces a repaint of the text, It's a hack to fix an occational
|
# Since we change the content while it may still be rendering, we mark
|
||||||
# issue where the find/replace above interfers with the rendering and
|
# the document dirty again to make sure it's re-rendered properly.
|
||||||
# leaves parts of the document blank.
|
self.qDocument.markContentsDirty(0, self.qDocument.characterCount())
|
||||||
self.qDocument.setTextWidth(self.qDocument.textWidth())
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user