PySide使用

一、安装
pip install --upgrade pip
pip install pyside6 -i https://mirrors.aliyun.com/pypi/simple/

(默认源:https://pypi.org/simple)
二、设计界面
pyside6-designer

三、转换UI文件
pyside6-uic hello.ui > ui.py

四、编辑程序
import sys
from PySide6.QtWidgets import QApplication, QWidget
from ui import Ui_Form

def main():
 app = QApplication(sys.argv)
 window = MyWidget()
 window.show()
 sys.exit(app.exec())

class MyWidget(QWidget):
 def __init__(self):
  super().__init__()
  self.ui = Ui_Form()
  self.ui.setupUi(self)

if __name__ == "__main__":
 main()

五、安装打包工具
pip install pyinstaller -i https://mirror.baidu.com/pypi/simple
pip install auto-py-to-exe -i https://mirror.baidu.com/pypi/simple

六、打包
auto-py-to-exe

参考:https://blog.csdn.net/qianbin3200896/article/details/126947934