Пример #1
0
 def do_strikethrough(self):
     with self.editing_cursor() as c:
         fmt = QTextCharFormat()
         fmt.setFontStrikeOut(not c.charFormat().fontStrikeOut())
         c.mergeCharFormat(fmt)
Пример #2
0
 def do_underline(self):
     with self.editing_cursor() as c:
         fmt = QTextCharFormat()
         fmt.setFontUnderline(not c.charFormat().fontUnderline())
         c.mergeCharFormat(fmt)
Пример #3
0
 def do_bold(self):
     with self.editing_cursor() as c:
         fmt = QTextCharFormat()
         fmt.setFontWeight(QFont.Weight.Bold if c.charFormat().fontWeight(
         ) != QFont.Weight.Bold else QFont.Weight.Normal)
         c.mergeCharFormat(fmt)
Пример #4
0
 def do_italic(self):
     with self.editing_cursor() as c:
         fmt = QTextCharFormat()
         fmt.setFontItalic(not c.charFormat().fontItalic())
         c.mergeCharFormat(fmt)
Пример #5
0
 def spell_property(sfmt, locale):
     s = QTextCharFormat(sfmt)
     s.setProperty(SPELL_LOCALE_PROPERTY, locale)
     return s