当前位置: 首页 > news >正文

网站栏目页怎么做培训学校加盟

网站栏目页怎么做,培训学校加盟,wordpress 5.1,江苏建设管理信息网站目录 1 Dialog 2 Main Window 3 Widget Dialog 模板,基于 QDialog 类的窗体,具有一般对话框的特性,如可以模态显示、具有返回值等。 Main Window 模板,基于 QMainWindow 类的窗体,具有主窗口的特性,窗口…

目录

1 Dialog

2 Main Window

3 Widget

Dialog 模板,基于 QDialog 类的窗体,具有一般对话框的特性,如可以模态显示、具有返回值等。

Main Window 模板,基于 QMainWindow 类的窗体,具有主窗口的特性,窗口上有主菜单栏、工具栏、状态栏等。

Widget 模板,基于 QWidget 类的窗体。QWidget 类是所有界面组件的基类,如 QLabel、QPushBtton 等界面组件都是从 QWidget 类继承而来的。QWidget 类也是 QDialog、QMainWindow 的父类,基于 QWidget 类创建的窗体可以作为独立的窗口运行,也可以嵌入到其他界面组件内显示。

1 Dialog

1.1 打开 designer.exe ,文件--新建--Dialog without Buttons--创建。

1.2 保存为 Dialog.ui。

1.3 使用 pyuic5 转换为  Dialog.py。
C:\Python\Python38-32\Scripts\pyuic5 -x Dialog.ui -o Dialog.py

# -*- coding: utf-8 -*-# Form implementation generated from reading ui file 'Dialog.ui'
#
# Created by: PyQt5 UI code generator 5.15.9
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.from PyQt5 import QtCore, QtGui, QtWidgetsclass Ui_Dialog(object):def setupUi(self, Dialog):Dialog.setObjectName("Dialog")Dialog.resize(400, 300)self.retranslateUi(Dialog)QtCore.QMetaObject.connectSlotsByName(Dialog)def retranslateUi(self, Dialog):_translate = QtCore.QCoreApplication.translateDialog.setWindowTitle(_translate("Dialog", "Dialog"))if __name__ == "__main__":import sysapp = QtWidgets.QApplication(sys.argv)Dialog = QtWidgets.QDialog()ui = Ui_Dialog()ui.setupUi(Dialog)Dialog.show()sys.exit(app.exec_())

1.4 运行 Dialog.py

C:\Python\Python38-32\python.exe Dialog.py

2 Main Window

2.1 打开 designer.exe ,文件--新建--Main Window--创建。

2.2 保存为 MainWindow.ui 。

2.3 使用 pyuic5 转换MainWindow.py。
C:\Python\Python38-32\Scripts\pyuic5.exe -x MainWindow.ui -o MainWindow.py

# -*- coding: utf-8 -*-# Form implementation generated from reading ui file 'MainWindow.ui'
#
# Created by: PyQt5 UI code generator 5.15.9
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.from PyQt5 import QtCore, QtGui, QtWidgetsclass Ui_MainWindow(object):def setupUi(self, MainWindow):MainWindow.setObjectName("MainWindow")MainWindow.resize(800, 600)self.centralwidget = QtWidgets.QWidget(MainWindow)self.centralwidget.setObjectName("centralwidget")MainWindow.setCentralWidget(self.centralwidget)self.menubar = QtWidgets.QMenuBar(MainWindow)self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 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)QtCore.QMetaObject.connectSlotsByName(MainWindow)def retranslateUi(self, MainWindow):_translate = QtCore.QCoreApplication.translateMainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))if __name__ == "__main__":import sysapp = QtWidgets.QApplication(sys.argv)MainWindow = QtWidgets.QMainWindow()ui = Ui_MainWindow()ui.setupUi(MainWindow)MainWindow.show()sys.exit(app.exec_())

2.4 运行 MainWindow.py。
C:\Python\Python38-32\python.exe MainWindow.py

3 Widget

3.1 打开 designer.exe ,文件--新建--Widget--创建。

3.2 保存为 Widget.ui。

3.3 使用 pyuic5 转换 Widget.py。
C:\Python\Python38-32\Scripts\pyuic5.exe -x Widget.ui -o Widget.py

# -*- coding: utf-8 -*-# Form implementation generated from reading ui file 'Widget.ui'
#
# Created by: PyQt5 UI code generator 5.15.9
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.from PyQt5 import QtCore, QtGui, QtWidgetsclass Ui_Form(object):def setupUi(self, Form):Form.setObjectName("Form")Form.resize(400, 300)self.retranslateUi(Form)QtCore.QMetaObject.connectSlotsByName(Form)def retranslateUi(self, Form):_translate = QtCore.QCoreApplication.translateForm.setWindowTitle(_translate("Form", "Form"))if __name__ == "__main__":import sysapp = QtWidgets.QApplication(sys.argv)Form = QtWidgets.QWidget()ui = Ui_Form()ui.setupUi(Form)Form.show()sys.exit(app.exec_())

3.4 运行 Widget.py。
C:\Python\Python38-32\python.exe Widget.py

其他:

创建一个调用 callWidget.py

# -*- coding: utf-8 -*-import sys
from PyQt5.QtWidgets import QApplication, QWidget
from Widget import Ui_Formclass QmyWidget(QWidget):def __init__(self, parent=None):# 调用父类构造函数,创建 QWidget 窗体super().__init__(parent)# 创建 UI 对象self.ui = Ui_Form()# 构造 UIself.ui.setupUi(self)if __name__ == "__main__":app = QApplication(sys.argv)Form = QmyWidget()Form.show()sys.exit(app.exec_())'''app = QApplication(sys.argv)Form = QWidget()ui = Ui_Form()ui.setupUi(Form)Form.show()sys.exit(app.exec_())
'''

参考:

《Python Qt GUI与数据可视化编程》

http://www.yayakq.cn/news/404048/

相关文章:

  • 国外网站建设平台成都优化外包
  • asp网站开发技术背景介绍wordpress链接公众号
  • 上海企业网站制作多少钱濮阳市平台公司
  • 前程无忧网站开发待遇怎么样wordpress的atl属性怎么设置
  • 网站的类型有哪些人工智能建筑设计软件
  • 网站怎么备案免费制作小程序游戏
  • c mvc制作网站开发陕西网站建设优化技术
  • 网站定制建设哪里好清爽网站
  • 网页制作与网站建设期末考试学淘宝运营去哪里学
  • 二七区建设局网站做外贸建网站
  • 义乌网站设计制作价格建设大型门户网站
  • 上海市建设项目施工审图网站创做阿里巴巴网站流程
  • 雪域什么网站是做电影的网站开发一个支付功能要好多钱
  • 惠州网站小程序建设点网站运营专员是干嘛的
  • 网站开发工程师的职责网络服务协议模板
  • 安徽省建设厅执业资格注册中心网站建设一个网站要多少费用吗
  • 开发网站公司交税wordpress回收站位置
  • 网站设计评价标准网络营销服务的种类
  • 漯河网站建设电话二级网站建设与管理会议
  • 建设网站需要什么设施免费网站建设公司联系方式
  • 国外的ps网站用户界面设计案例
  • 记事本做的网站链接怎么装饰学网站建设需要下载什么
  • 企业建网站多少钱建设手机银行网站
  • 手机企业网站设计理念湖南长沙网站制作
  • h5网站开发公司谷歌商店下载
  • 杭州网站建设报价wordpress 标签链接
  • 做网站办公照片网站建设建设公司
  • 免费做手机网站有哪些用于建设教学网站的建站工具有哪些特点
  • 公司门户网站的意义东仓建设网站
  • 2013电子商务网站建设广告联盟怎么赚钱