Last active
June 10, 2018 04:47
-
-
Save rvvvt/f2218bbbf84c40f9ef61eecba95111e6 to your computer and use it in GitHub Desktop.
template for quickly loading your Qt Designer UI files for your python applications.
This file contains hidden or 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 qtpy import uic, QtWidgets, QtCore, QtGui | |
class MainWindow(QtWidgets.QMainWindow): | |
def __init__(self): | |
super(MainWindow, self).__init__() | |
# save your ui file in same directory and put filename below | |
uic.loadUi('your_ui_file.ui', self) | |
self.show() | |
if __name__ == '__main__': | |
app = QtWidgets.QApplication(sys.argv) | |
window = MainWindow() | |
sys.exit(app.exec_()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment