python Gui設(shè)計(jì) - pyqt5 qt designer
安裝(推薦python3.10安裝)
pip install pyqt5-tools
啟動(dòng)qt designer
C:\Python310\Scripts>pyqt5-tools.exe designer
或
C:\Python310\Lib\site-packages\qt5_applications\Qt\bin\designer.exe
安裝uic,一個(gè)生成將qt disigner保存下來(lái)生成python code的tool
C:\Python310\Scripts>pyqt5-tools.exe installuic
構(gòu)建自己的UI
將左側(cè)的wigget拖動(dòng)到頁(yè)面, File->Save as -> xx.ui

添加信號(hào)槽
Edit->Edit Signal/Slots
查看效果
CTRL+R
或
Form->Preview
生成python code
C:\Python310\Lib\site-packages\qt5_applications\Qt\bin\uic.exe -x c:\Users\Downloads\untitled.ui -o demo.py
運(yùn)行demo.py檢查是否和自己構(gòu)建的ui一致
浙公網(wǎng)安備 33010602011771號(hào)