-
Notifications
You must be signed in to change notification settings - Fork 3
templates
Egor edited this page Apr 10, 2018
·
1 revision
#!-*-coding:utf-8-*-
import sys
# import PyQt5
from PyQt5.QtWidgets import *
from PyQt5 import uic
( Ui_MainWindow, QMainWindow ) = uic.loadUiType( '${Form_file}.ui' )
class MainWindow ( QMainWindow ):
"""MainWindow inherits QMainWindow"""
def __init__ ( self, parent = None ):
QMainWindow.__init__( self, parent )
self.ui = Ui_MainWindow()
self.ui.setupUi( self )
def __del__ ( self ):
self.ui = None
#-----------------------------------------------------#
if __name__ == '__main__':
# create application
app = QApplication( sys.argv )
app.setApplicationName( '${PROJECT_NAME}' )
# create widget
w = MainWindow()
w.setWindowTitle( '${PROJECT_NAME}' )
w.show()
app.installEventFilter(w)
# execute application
sys.exit( app.exec_() )
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>640</width>
<height>480</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
</widget>
<resources/>
<connections/>
</ui>