安装pyside6
>>> pip install pyside6
查看QT Designer程序
>>> pip show pyside6
Location: c:\users\Administrator\...\python\python39\site-packages
//若上述代码运行报错
>>> where python
C:\...\Python\Python39\python.exe
python文件夹内搜索
C:\...\Python\Python39\site-packages\PySide6\designer.exe
Ⅰ. Init
from PySide6.QtWidgets import *
class Window:
def __init__(self):
self.win = QMainWindow()
if __name__ == '__main__':
app = QApplication([])
w = Window()
w.win.show()
app.exec_()
from PySide6.QtWidgets import *
if __name__ == '__main__':
app = QApplication([])
win = QMainWindow()
win.show()
app.exec_()
Ⅱ Example