Installation and use of PyQt

I. Background

First, there is a window interface development tools in many choices, the mainstream is Qt, and the python window interface also supports a number of languages, including C ++, Java and so on. So tell us about here on the installation and use of PyQt5

Second, the installation

Since python2 no longer officially maintained and python3 no longer support PyQt4, so here use PyQt5
python3 installation command:
install pyqt5

pip install pyqt5

Install Qt-Designer

pip install pyqt5-tools

Third, the configuration of the output file

Need to extend out of the external tools in the Designer and convert files pyuic, these two tools
1.Designer
Designer is used to build the file, the file is constructed out by pyuic xxx.ui file to install file into xxx.py
2 .PyUIC
pyuic is to convert the file to convert files into xxx.py xxx.ui file, recalled later file

Instruction PyUIC output command xxx.py file by clicking on it to convert files into xxx.py file xxx.ui

pyuic -o xxx.py xxx.ui

Output image


Forms of the above command line is disposed in the pycharm
1. Open the expansion tool
into the settings
illustrate

2. Configure QtDesigner
in python compiler environment the following: Scripts file that contains designer.exe the
need to fill configuration:
1.program path
is designer.exe program can run
2.working directory directory

$ProjectFileDir$

result
illustrate

3. Configure PyUIC
in python compiler environment the following: Scripts file that contains pyuic5.exe the
need to fill out the parameters
1.program
is operable pyuic5.exe file
2.arguments
because of the need to convert files into xxx.ui xxx. py file

$FileName$ -o $FileNameWithoutExtension$.py

3.working directory

$ProjectFileDir$

result
illustrate

4.
Open the tool designer in the following, and save it as a file UI
illustrate

IV Summary

PyQt5 is still very powerful and easy to use is very convenient when, late in perfect PyQt5 specific learning content, blog Park this markdown really ugly, followed by re-optimization
cattle passenger address

Guess you like

Origin www.cnblogs.com/future-dream/p/12127817.html