Skip to content

Instantly share code, notes, and snippets.

@rvvvt
Last active June 10, 2018 04:47
Show Gist options
  • Save rvvvt/f2218bbbf84c40f9ef61eecba95111e6 to your computer and use it in GitHub Desktop.
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.
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