VScode Pyqt配置_搜素 VScode Pyqt配置
VScode Pyqt配置

安装pyqt5

Win + R输入cmd打开命令提示符

pip3 install -i https://mirrors.aliyun.com/pypi/simple/ PyQt5

pip3 install -i https://mirrors.aliyun.com/pypi/simple/ PyQt5-tools

安装vscode扩展

搜素pyqt integration 安装

VScode Pyqt配置_pyqt5_02

配置扩展

VScode Pyqt配置_pyqt5_03

  • 找到 Pyqt-integration › Pyuic: Cmd 确认内容为 pyuic5

    VScode Pyqt配置_python_04

  • 找到 Pyqt-integration › Pyuic › Compile: Filepath 确认内容为

    VScode Pyqt配置_python_05

添加Qt_designer

打开文件管理器,搜索designer.exe 复制路径加上\designer.exe

D:\Python3.9.6\Lib\site-packages\qt5_applications\Qt\bin\designer.exe

VScode Pyqt配置_qt5_06

使用

创建UI文件:在文件夹右键:PYQT: New Form

VScode Pyqt配置_pyqt5_07

编译UI文件:PYQT:compile from

  • 编译产生的py文件名和ui文件名对应

    VScode Pyqt配置_搜素_08

  • 编译产生的py文件中的类名和designer中objectName名对应

VScode Pyqt配置_python_09

VScode Pyqt配置_搜素_10