mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-17 11:22:28 +12:00
Small bug
This commit is contained in:
parent
ef1ba855e7
commit
ed0bfed8dc
|
@ -29,7 +29,9 @@ class basicHighlighter(QSyntaxHighlighter):
|
|||
"""Apply syntax highlighting to the given block of text.
|
||||
"""
|
||||
|
||||
QTextCursor(self.currentBlock()).setBlockFormat(self._defaultBlockFormat)
|
||||
bf = QTextBlockFormat(self._defaultBlockFormat)
|
||||
bf.setAlignment(QTextCursor(self.currentBlock()).blockFormat().alignment())
|
||||
QTextCursor(self.currentBlock()).setBlockFormat(bf)
|
||||
#self.setFormat(0, len(text), self._defaultCharFormat)
|
||||
|
||||
# Spell checking
|
||||
|
|
|
@ -456,15 +456,15 @@ class textEditView(QTextEdit):
|
|||
|
||||
cursor = self.textCursor()
|
||||
|
||||
bf = cursor.blockFormat()
|
||||
#bf = cursor.blockFormat()
|
||||
bf = QTextBlockFormat()
|
||||
bf.setAlignment(
|
||||
Qt.AlignLeft if _format == "Left" else
|
||||
Qt.AlignHCenter if _format == "Center" else
|
||||
Qt.AlignRight if _format == "Right" else
|
||||
Qt.AlignJustify)
|
||||
print(bf.alignment() == Qt.AlignLeft)
|
||||
|
||||
cursor.mergeBlockFormat(bf)
|
||||
cursor.setBlockFormat(bf)
|
||||
self.setTextCursor(cursor)
|
||||
|
||||
elif self._textFormat == "t2t":
|
||||
|
|
Loading…
Reference in a new issue