如何将Qt Designer设计的ui文件转成py文件

1、安装pyqt和PyQt-tools,注意:需要保证两个包的版本一致

pip install  pyqt6 PyQt6-tools

2、实验Qt Designer设计的ui文件,如新建一个test.ui文件

 

3、切换到你保存ui的目录,然后使用命令将test.ui转换成py文件,转换成功后即可在python中调用qt控件

pyuic6 test.ui > test_ui.py

 

参考:

https://muzing.top/posts/75a2283d/
https://blog.csdn.net/humanking7/article/details/80403189

posted @ 2024-04-26 11:23  平平无奇小辣鸡  阅读(1469)  评论(0)    收藏  举报