Pyqt5 学习笔记(一)环境搭建
in 杂项 with 0 comment

参考:

https://zhuanlan.zhihu.com/p/341564754

1. 安装

1.1 anaconda管理python及依赖

https://www.anaconda.com/products/distribution

1.2 使用清华源

 pip install PyQt5 --trusted-host pypi.tuna.tsinghua.edu.cn
// python3.5以上需要安装
 pip install pyqt5-tools --trusted-host pypi.tuna.tsinghua.edu.cn

2. 启动Qtdesigner

designer

3. Pycharm 扩展设置

项目创建完毕后开始配置qt扩展
点击File ——> Setting
在弹出界面中选择 Tools下的 External Tools 进行配置,如下图所示

依次填入2个扩展

// QtDesigner 方便便捷打开GUI页面
Name: QtDesigner
Group: Qt
Program: xxxxx\xxxxxx\designer.exe
Working Directory: $ProjectFileDir$
// pyuic5快捷转换ui为py文件,先选中ui文件再点击扩展即可在同目录下生成py
Name: pyUIC
Group: Qt
Program: xxxxx\xxxxxx\pyuic5.exe
Arguments: $FileName$ -o $FileNameWithoutExtension$.py
Working Directory: $FileDir$
The article has been posted for too long and comments have been automatically closed.