Centering a window on the screen with Qt

Yet another thing that’s not automagic in Qt. Here’s a python solution: if __name__ == "__main__":    app = QtGui.QApplication(sys.argv)    dw = app.desktop().width()    dh = app.desktop().height()    myapp = MainWindow()    myapp.setGeometry(          int((dw – (dw – (dw / 2)) * 1.5) / 2),          int((dh – … Continue reading Centering a window on the screen with Qt