python 2.7 - Does pyqt text edit has a font overline property -
i know pyqt qtextchar format has font overline property pyqt textedit
has font italic,bold , underline.does textedit font overline exists??
then syntax?
the answer yes has,
try this:
import sys pyqt5.qtwidgets import qapplication pyqt5.qtwidgets import qtextedit pyqt5.qtwidgets import qvboxlayout pyqt5.qtwidgets import qwidget class widget(qwidget): def __init__(self): super(widget, self).__init__() self.text_edit = qtextedit("overlining...") self.text_edit.setstylesheet(""" text-decoration: overline; """) self.layout = qvboxlayout() self.setlayout(self.layout) self.layout.addwidget(self.text_edit) if __name__ == '__main__': app = qapplication(sys.argv) wid = widget() wid.show() sys.exit(app.exec_()) you have lot of other properties , examples can have look.
there other approaches, 1 of them instead of making use of stylesheet can set "html" properties of qdocument, having this:
self.text_edit = qtextedit() personalized_document = qtextdocument() personalized_document.set...#set need example overline need. self.text_edit.setdocument(personalized_document)
Comments
Post a Comment