Pyqt5 and qt-designer
We installed the python3-pyqt5 package in Ubuntu can use pyqt5 programming, but only use pure code to write the form, very troublesome. We will use qt-designer to design the form.
Install PyQt 5 in Ubuntu
We can install the qt4-designer package through the new, or through the shell command apt-get install. The interface is as follows:
After the software design form is complete, it is saved as a ui file. We need to convert it to a py file. We need to use the command pyuic5 or pyuic4. we cannot use this command because the corresponding package is not installed.
This command is in the pyqt4-dev-tools package, we can install it through the new or shell command.
Conversion FILE command:
# Generate a. pypyuic4-o a. py a. ui
Let's take a look at the newly generated a. py:
A class Ui_Form is automatically generated, and the class has a method setupUi ()
Create a python file and import a. py
Import sys from PyQt5.QtWidgets import QApplication, QWidget # import the corresponding package from a import * if _ name _ = '_ main _': app = QApplication () w = QWidget () ui = Ui_Form () ui. setupUi (w) w. show () sys. exit (app.exe c _())
Build Python3.4 + PyQt5.5.1 + Eric6.1.1 development platform under Mac OS X 10.11.1
Build Python3.4 + PyQt5.3.2 + Eric6.0 development platform in Ubuntu 14.04
Install PYQT4 and Eric4 on Ubuntu 12.04
Install and configure Python 3.2.3 In Ubuntu integrated development environment Eric5
For more information, see PyQt4.
Recommended learning: Analysis of PyQt4 highlights
Install Python3.4 on CentOS source code
Python core programming version 2. (Wesley J. Chun). [Chinese version of hd pdf]
Python development technology details. (Zhou Wei, Zong Jie). [hd PDF scan version + book guide video + code]
PyQt details: click here
PyQt: click here
This article permanently updates the link address: