资源简介

PyQt5系列教程(二)利用QtDesigner设计UI界面源码包,博文地址http://blog.csdn.net/djstavaV/article/details/50282527

资源截图

代码片段和文件信息

# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file ‘firstPyQt5.ui‘
#
# Created by: PyQt5 UI code generator 5.5.1
#
# 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(631 600)
        self.centralwidget = QtWidgets.QWidget(mainWindow)
        self.centralwidget.setobjectName(“centralwidget“)
        self.pushButton = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton.setGeometry(QtCore.QRect(250 130 131 61))
        font = QtGui.QFont()
        font.setPointSize(22)
        self.pushButton.setFont(font)
        self.pushButton.setobjectName(“pushButton“)
        mainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(mainWindow)
        self.menubar.setGeometry(QtCore.QRect(0 0 631 22))
        self.menubar.setobjectName(“menubar“)
        mainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(mainWindow)
        self.statusbar.setobjectName(“statusbar“)
        mainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(mainWindow)
        self.pushButton.clicked.connect(self.firtPyQt5_button_click)
        QtCore.Qmetaobject.connectSlotsByName(mainWindow)

    def retranslateUi(self mainWindow):
        _translate = QtCore.QCoreApplication.translate
        mainWindow.setWindowtitle(_translate(“mainWindow“ “第一个PyQt5程序“))
        self.pushButton.setText(_translate(“mainWindow“ “点我弹框“))


    def firtPyQt5_button_click(self):
        QtWidgets.QMessageBox.information(self.pushButton“标题““这是第一个PyQt5 GUI程序“)

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-12-13 13:21  firstPyQt5\
     目录           0  2015-12-13 13:30  firstPyQt5\.idea\
     文件          10  2015-12-13 12:44  firstPyQt5\.idea\.name
     文件         159  2015-12-13 12:44  firstPyQt5\.idea\encodings.xml
     文件         398  2015-12-13 12:44  firstPyQt5\.idea\firstPyQt5.iml
     文件         727  2015-12-13 12:44  firstPyQt5\.idea\misc.xml
     文件         272  2015-12-13 12:44  firstPyQt5\.idea\modules.xml
     文件       21960  2015-12-13 13:30  firstPyQt5\.idea\workspace.xml
     目录           0  2015-12-13 13:21  firstPyQt5\__pycache__\
     文件        1873  2015-12-13 13:21  firstPyQt5\__pycache__\firstPyQt5.cpython-35.pyc
     文件        1772  2015-12-13 13:21  firstPyQt5\firstPyQt5.py
     文件         121  2015-12-13 12:50  firstPyQt5\firstPyQt5.qrc
     文件         373  2015-12-13 12:51  firstPyQt5\main.py

评论

共有 条评论