pip install pyqt5
pip install pyqt5-tools
打开Pycharm——File——Settings——Tools——External Tools,点击+号,按照如下设置外部工具:
Name:QtDesinger
Program:C:\Program Files\Python36\Lib\site-packages\PyQt5-tools\designer\designer.exe
Linux: /.../yourpath/lib/python3.7/site-packages/qt5_applications/Qt/bin/designer
Working directory:$ProjectFileDir$
Name:PyUIC
Program:C:\Program Files\Python36\python.exe
Arguments:-m PyQt5.uic.pyuic $FileName$ -o $FileNameWithoutExtension$.py
Working directory:$ProjectFileDir$
启动 designer
报错:
qt5_applications/Qt/plugins/platforms/libqxcb.so: (libxcb-util.so.1: 无法 打开共享对象文件: 没有那个文件或目录)"
解决:
sudo ln -s /usr/lib/x86_64-linux-gnu/libxcb-util.so.0 /usr/lib/x86_64-linux-gnu/libxcb-util.so.1
估计qt的开发人员使用的Linux版本不是Debian系的,依赖了libxcb-util.so.1,然而在Debian系上,这个依赖库不叫libxcb-util.so.1,而叫libxcb-util.so.0,所以,为其添加软连接即可。
https://www.jb51.net/article/162137.htm
https://blog.csdn.net/Fozei/article/details/116160454