PyQt5 Introduction and Installation

 

PyQt5 Profile

PyQt5 application framework is combined with a set of python Digia Qt5, support and 2.x 3.x. This tutorial uses a 3.x. Qt library developed by the Riverbank Computing, one of the most powerful GUI library official website: www.riverbankcomputing.co.uk/news .

PyQt5 is a series of Python modules. Over 620 class, 6000 functions and methods. To run on mainstream operating systems such as Unix, Windows and Mac OS and so on. PyQt5 two certificates, GPL and commercial certificates.

PyQt5 class is divided into many modules, main modules are:

QtCore contains the core non-GUI functionality. The main and time, files and folders, various data streams, URLs, mime type file, the process used in conjunction with thread.

QtGui includes window systems, event processing, 2D images, basic drawing, font and text classes.

QtWidgets

QtMultimedia

installation

1) installation PyQt5, QtDesigner, PyUIC, opencv other tools

(Before that, we need to complete the installation of python and pip tools)

Open cmd window, enter

pip install pyqt5

The computer will automatically download and install the appropriate version of pyqt5.

Upon completion, then enter

pip install pyqt5-tools

QtDesigner PyUIC automatically complete the installation and the like.

In addition, I am in the process of programming and also used the opencv qimage2ndarray modules, and finally if you want to generate exe executable file you also need to install pyinstaller, its installation commands are:

1

2

3

pip install opencv-python

pip install qimage2ndarray

pip install pyinstaller

At this point, all modules are used in the installation is complete.

2 See Method mounting http://code.py40.com/444.html

2 QtDesigner and PyUIC linked to the external tool library PyCharm

Qtdesigner Python is a design which very useful tool, such that it may be prepared not only pure qt interface code, and may be provided on the basis of the visualization, is very convenient.

After users install PyQt5, the system will be installed by default QtDesigner tool.

Default Default path QtDesigner of: E: \ python \ python \ Lib \ site-packages \ PyQt5 \ designer.exe

*** The person I see is in the Scripts below (at the end of the EXE in my scripts below)

Configuration PyCharm

Open Pycharm, then the following path open Extrernal Tools

File-> Tools-> Extrernal Tools-> click on the "+" sign -> pop-up dialog box with the following configuration

. (1) increase the QT interface design "Qt Designer" - this is the tool Qt interface design

  • Program selection path PyQt installation directory of designer.exe
  •  Working directory at set their own working path, qtdesigner generated ui files saved in the default path. 'Arguments' not set, to confirm.

(2) increasing the "PyUIC" - this is mainly used to convert the interface into Qt py Code

pyuic qtdesigner for converting the file into the generated .ui python .py files can be identified. Process is provided as shown below, Programs, enter the path and file name where python.exe, Arguments enter:

1

-m PyQt5.uic.pyuic -o $FileNameWithoutExtension$.py $FileName$

In Working directory enter:

$FileDir$

Py file will thus generated and converted ui files located in the same folder. Click ok to complete the setup.

Method 2 (I do not see pyuic5.bat)

After configuring the installation is complete you can see in our tool oh tools inside

Reference http://code.py40.com/2540.html

https://www.jb51.net/article/170810.htm

Published 100 original articles · won praise 18 · views 30000 +

Guess you like

Origin blog.csdn.net/sereasuesue/article/details/105149528
Recommended