def __init__(self): QApplication.__init__(self, sys.argv) # Enable High DPI display with PyQt5 if hasattr(Qt, 'AA_UseHighDpiPixmaps'): self.setAttribute(Qt.AA_UseHighDpiPixmaps) self.setApplicationName("Algorithm Visualizer") with open(AbsJoin(APP_ROOT, "resources/stylesheet.qss")) as styleSheetFile: self.setStyleSheet(styleSheetFile.read()) self.mainWindow = QMainWindow() self.mainWindow.setProperty("class", "MainWindow") self.mainWindow.resize(1024, 768) self.mainWidget = MainWidget() self.mainWindow.setCentralWidget(self.mainWidget) self.mainWindow.show() # this needs to happen after the main window is shown self.mainWidget.showTopAlgorithm() sys.exit(self.exec_())
def __init__(self, *args): QApplication.__init__(self, *args)