The font dropdown is set up using QFontComboBox a Qt builtin which shows the fonts available on the host system, with each font listed by name with a demo of the font. The editor toolbar is setup using a QToolBar to which we add a number of Receive a signal every time the current selection changes. selectionChanged signal from the editor, we We need our toolbar to update automatically when clicking/selecting text within the editor. # We need to repeat the size to init the current format. # Setup the QTextEdit editor configuration Super(MainWindow, self)._init_(*args, **kwargs) The default font is set to Times New Roman 12pt. We switch on rich text mode for the editor component and enable auto-formatting (currently only bullet listsįrom *). The QTextEdit component (which we've subclassed as TextEdit) has some additional setup requirements. You need to add the new type to both the `canInsertFromMimeData` and `insertFromMimeData` handlers. You can use these methods to support other types, e.g. Where drop an URL/file (try dragging a file into the window). One where we are adding from an image directly (try dragging an image from a browser window) and one
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |