Apr-24-2017, 08:41 PM
i am setting a simple text editor and one of its item is the capability of formatting the font. i am using a dialog box to chose the font and giving a default value; i am using QFont to set the default. I would like to set the default to 'consolas' or 'liberation mono'; i found the former to be easier to implement. however when i launch the window, the default font is not 'consolas'.
how shall i set the code for QFont in order to get 'consolas' or 'liberation mono' regular?
this is the code i wrote:
how shall i set the code for QFont in order to get 'consolas' or 'liberation mono' regular?
this is the code i wrote:
def fontChange(self): (font, ok) = QFontDialog.getFont(QFont("Consolas", 11), self) if ok: self.textEdit.setCurrentFont(font)thanks