标签:push ade widgets ase author uil rect 文件 slot
操作系统: Windows 10 专业版 64-bit (10.0, Build 16299) (16299.rs3_release.170928-1534)
Python Version: 3.7.1
PyQt5 Version: 5.11.3
Qt Designer Version: 5.11.2
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file ‘firstMainWin.ui‘
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(800, 600)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.pushButton = QtWidgets.QPushButton(self.centralwidget)
self.pushButton.setGeometry(QtCore.QRect(220, 160, 141, 51))
self.pushButton.setObjectName("pushButton")
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 23))
self.menubar.setObjectName("menubar")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "haha"))
self.pushButton.setText(_translate("MainWindow", "PushPush"))
‘‘‘
PyQt5 实现显示和业务逻辑分离, 继承主界面文件的主窗口类
@Author: Notus(hehe_xiao@qq.com)
@Create: 2019-02-10
@Update: 2019-02-10
‘‘‘
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
from firstMainWin import *
class MyMainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, parent=None):
super(MyMainWindow, self).__init__(parent)
self.setupUi(self)
if __name__ == "__main__":
app = QApplication(sys.argv)
myWin = MyMainWindow()
myWin.show()
sys.exit(app.exec_())
标签:push ade widgets ase author uil rect 文件 slot
原文地址:https://www.cnblogs.com/leo1875/p/10359575.html