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

山西网站建设推广购物车按钮颜色wordpress

山西网站建设推广,购物车按钮颜色wordpress,重庆酉阳网站设计公司,网站表格边框怎么做目录 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/335833/

相关文章:

  • 黄石做网站公司网络货运怎么做的
  • 对文化传播网站建设的建议中国建筑官网测评
  • 网站建设的报告大庆seo推广
  • 上海做网站多少费用广州软件开发工资一般多少
  • 传奇背景图网站怎么做刷手机网站关键词
  • 建行官方网站 - 百度有关网站开发的论文
  • 网站怎么做伪静态做电商网站一般需要什么流程图
  • 湛江手机网站制作网站开发合同支付
  • 网站分析怎么做的网站开发主要步骤
  • 微网站生成app世界购物平台排行榜
  • 网站锚文本延吉网站制作
  • 学生网站建设首页软件详细设计文档
  • 网络网站租邯郸市博物馆
  • 温州建站费用用什么网站做问卷
  • 做爰网站做网站一定要有营业执照吗
  • 成品网站 修改首页网站app微信三合一
  • 小米网站建设案例山西网站制作工具
  • 访问失效链接 如何删除 网站维护文章网站后台管理系统
  • phpcms 移动网站模板深圳做自适应网站制作
  • 做网站软件j做天猫网站设计难吗
  • 优质的武进网站建设昆明网站搜索优化
  • 找代理做网站多少钱网站建设哪里比较好
  • 网站建设报价单 excel无锡品牌网站建设
  • 网站统计系统 怎么做重庆做网站的
  • 海淀区手机网站制作服务沧州网站建设培训学校
  • 来年做那个网站致富网片的重量计算公式
  • 建设网站必须要服务器C4D有哪些做模型的网站
  • 广州微网站建设咨询上海发布首页
  • 泉州建设公司网站网站商城支付宝开通怎么做
  • 全站flash网站域名注册网站 不认证