Pyqt5 and qt-designer

Source: Internet
Author: User

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:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.