一:安装PyQt5
1.首先就是pip安装PyQt5:
pip install PyQt5
2.然后需要安装Qt工具,也选择pip安装:
pip install PyQt5-tools
二:添加QtDesigner和PyUIC
1.file->settings
2.tools->external tools->+
3.添加QtDesigner
(根据自己的路径进行配置)
program:
D:\ProgramData\Anaconda3\Library\bin\designer.exe
working directory:
D:\ProgramData\Anaconda3\Library\bin
4.添加PyUIC
program:
D:\ProgramData\Anaconda3\envs\tf1.15\python.exe
arguments:
-m
PyQt5.uic.pyuic
$FileName$
-o
$FileNameWithoutExtension$.py
working directory:$FileDir$
5.apply->ok
至此,配置完成。
如何将.ui文件转成.py文件?
选中想要转换的ui文件,右击,external tools->PyUIC