Python Forum

Full Version: set default font main window pyside
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am setting a simple text editor with PySide (python) and I would like to set the default font as, let's say, liberation mono. I am not interested in changing the font so I just need to set the font once for the main object. How would i do that?
this is the code I wrote to implement the main window:
class MainWindow(QMainWindow):
    def __init__(self):
        super(MainWindow, self).__init__()
        self.initGUI()

    def initGUI(self):
        self.setWindowTitle("ScribblerSeq")
        self.setWindowIcon(QIcon('./icon/appicon.png'))
        self.setGeometry(1200, 1800, 800, 600)
        self.statusLabel = QLabel('Showing Progress')
        self.CreateProgessBar()
        self.CreateStatusBar()
        self.center()
        self.SetupComponents()
        self.show()
thank you