Created
April 16, 2021 02:55
-
-
Save quan99-er/eebc2a62be4cc3fbc13c686b70be7a9e to your computer and use it in GitHub Desktop.
auto-load GUI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from PyQt4 import QtCore, QtGui, uic | |
qtCreatorFile = "TestForm.ui" # Enter file here. | |
Ui_MainWindow, QtBaseClass = uic.loadUiType(qtCreatorFile) | |
class MyApp(QtGui.QMainWindow, Ui_MainWindow): | |
def __init__(self): | |
QtGui.QMainWindow.__init__(self) | |
Ui_MainWindow.__init__(self) | |
self.setupUi(self) | |
if __name__ == "__main__": | |
app = QtGui.QApplication(sys.argv) | |
window = MyApp() | |
window.show() | |
sys.exit(app.exec_()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment