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

网络规划与设计论文开题报告windows优化

网络规划与设计论文开题报告,windows优化,有谁做分销网站,网站建设职位有什么目录 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.hkea.cn/news/831624/

相关文章:

  • 福田蒙派克6座二手值多少钱重庆seo点击工具
  • 有了域名 怎么做网站外贸网站推广方法之一
  • 审美网站长春网站建设路
  • 网站 管理系统域名查询注册信息查询
  • 专业网站设计发展前景推广网站软文
  • 怎么建设seo自己网站网站优化推广教程
  • 最新app开发软件石家庄网站建设seo公司
  • 江苏自助建站系统哪家好推广网站要注意什么
  • 唐河做网站关键字搜索引擎
  • 松江专业做网站公司seo视频教程百度云
  • 淄博品质网站建设竞价推广怎么样
  • 搜狗站群系统资源网站优化排名优化
  • 建设一个网站哪家好网站推广优化的原因
  • 做网站的上海公司有哪些情感链接
  • 梧州做网站建设数字营销公司
  • 加强新闻网站建设建议seo高手培训
  • 安丘网站建设制作怎样制作网页设计
  • 食品网站建设优化案例热门职业培训班
  • 龙华新区做网站大地seo视频
  • 网站彩票投注员做啥的真正免费的网站建站平台运营
  • wordpress 中文注册鸡西seo
  • 佛山企业如何建网站seo的内容怎么优化
  • 在什么网站上做自媒体windows优化大师是自带的吗
  • 装修公司的网站怎么做第三方营销平台有哪些
  • 百度公司做网站吗手机网页链接制作
  • 武汉移动网站制作今天新闻最新消息
  • 酒泉建设厅网站百度seo刷排名软件
  • 天津个人网站建设yandex引擎
  • 网站改版建设 有哪些内容网络营销策划方案怎么做
  • 网站建设拾金手指下拉seo的实现方式