Clean up warnings and deprecations in gui components

This commit is contained in:
Veronica Berglyd Olsen
2025-01-13 02:21:56 +01:00
parent a60e0b3c87
commit 5027b8df19
14 changed files with 458 additions and 474 deletions
+8 -8
View File
@@ -272,14 +272,14 @@ class GuiDocHighlighter(QSyntaxHighlighter):
"""Loop through all blocks and re-highlight those of a given
content type.
"""
qDoc = self.document()
nBlocks = qDoc.blockCount()
tStart = time()
for i in range(nBlocks):
block = qDoc.findBlockByNumber(i)
if block.userState() & cType > 0:
self.rehighlightBlock(block)
logger.debug("Document highlighted in %.3f ms" % (1000*(time() - tStart)))
if document := self.document():
nBlocks = document.blockCount()
tStart = time()
for i in range(nBlocks):
block = document.findBlockByNumber(i)
if block.userState() & cType > 0:
self.rehighlightBlock(block)
logger.debug("Document highlighted in %.3f ms" % (1000*(time() - tStart)))
return
##