PyCharm安装配置Qt Designer+PyUIC教程

Qt Designer用于像VC++的MFC一样拖放、设计控件

PyUIC用于将Qt Designer生成的.ui文件转换成.py文件

Qt Designer和PyUIC都包含在PyQt5中,所以我们只需要安装PyQt5塻块然后再指定Qt Designer和PyUIC即可

为了避免篇幅过长,本文只讲安装配置,使用可查看“PyCharm+QTDesigner+PyUIC使用教程

 

一、安装PyQt5

Qt Designer包含在PyQt5中,而PyQt5就是一个python模块,所以我们可以直接通过“pip3 install PyQt5”安装

但是我们这里使用PyCharm集成开发环境,所以直接通过PyCharm安装

打开PyCharm,新建一个项目

《PyCharm安装配置Qt Designer+PyUIC教程》

《PyCharm安装配置Qt Designer+PyUIC教程》

《PyCharm安装配置Qt Designer+PyUIC教程》

《PyCharm安装配置Qt Designer+PyUIC教程》

 

二、指定Qt Designer和PyUIC

《PyCharm安装配置Qt Designer+PyUIC教程》

 Name–输入最后工具在菜单中的想呈现名称,比如我这里命名为QTDesigner

Program–designer.exe程序的位置,位于当前所用解析器的Lib\site-packages\pyqt5-tools\designer.exe

Working directory–designer.exe工作路径,设置为$ProjectFileDir$

 《PyCharm安装配置Qt Designer+PyUIC教程》

类似地添加PyUIC,

name—-PyUIC

Program—-PyUIC位于当前解析器的Scripts\pyuic5.exe

Arguments—-$FileName$ -o $FileNameWithoutExtension$.py

Working dirctory—-$ProjectFileDir$

《PyCharm安装配置Qt Designer+PyUIC教程》

《PyCharm安装配置Qt Designer+PyUIC教程》

回到主界面“Tools”–“External Tools”即可看到我们添加的QTDesigner和PyUIC

《PyCharm安装配置Qt Designer+PyUIC教程》

    原文作者:谭青海
    原文地址: https://blog.csdn.net/Dreamhai/article/details/82701063
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞