一,安裝PySide2
- 打開Windows命令提示符
- 安裝PySide2,輸入:pip install pyside2 或 pip install pyside2 -i https://pypi.mirrors.ustc.edu.cn/simple/
二,安裝PySide2的插件 PySide2-VSC
- 進入拓展商店界面
- 搜索PySide2-VSC,找到:PySide2-VSC,點擊安裝
-
等同插件:Qt for Python,支持PyQt5和PySide2,尋找一個.ui文件右鍵點擊
三,使用補充說明
- 第一次打開PySide2:New Form in Designer/Creator,需要尋找到designer.exe,即C:\Python38\Lib\site-packages\PySide2\designer.exe,(designer.exe路徑設置),以后就可打開了
- 也可以在setting.json中手動設置路徑,例如PySide2-VSC
"pyside2-vsc.designer-creator.path": "c:\\Python38\\Lib\\site-packages\\PySide2\\designer.exe",
Qt for Python
"qtForPython.path.designer": "D:\\Qt\\Qt5.12.4\\5.12.4\\mingw73_32\\bin\\designer.exe", "qtForPython.path.linguist": "D:\\Qt\\Qt5.12.4\\5.12.4\\mingw73_32\\bin\\linguist.exe", "qtForPython.path.qmlscene": "D:\\Qt\\Qt5.12.4\\5.12.4\\mingw73_32\\bin\\qmlscene.exe --verbose", "qtForPython.path.pyrcc": "pyrcc5 -o ./\"${fileBasenameNoExtension}.py\"", "qtForPython.path.pyuic": "pyuic5 -d -o ./\"${fileBasenameNoExtension}.py\"",
-
拓展可以配置的屬性Properties查看,在拓展欄中點擊已下載好的拓展插件,如PySide2-VSC