install pycharm 2022-2
settings->python interpreter->add icon
pyqt5 and pyqt5-tools and pyqt5designer
pip install pyqt5 pyqt5-tools pyqt5designer -i https://pypi.douban.com/simple/
settings->tools-external tools add
name= qt designer
prog= D:\py37\Lib\site-packages\QtDesigner\designer.exe
wd= $ProjectFileDir$
name= pyuic
pro= D:\py37\python.exe
arg= -m PyQt5.uic.pyuic $FileName$ -o $FileNameWithoutExtension$.py
wd= $FileDir$
last:
use qt designer to create ui file
select a ui file and click pyuic to get its py file
add:
import sys
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui=Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())
in py file
and run the py file