Pyqt5 简明教程
PyQt5 - Introduction
PyQt 是一个 GUI 控件工具包。它是 Qt 的 Python 接口,该接口是最强大、最流行的跨平台 GUI 库之一。PyQt 由 RiverBank Computing Ltd 开发。可以在其官方网站 − riverbankcomputing.com 下载 PyQt 最新版本。
PyQt is a GUI widgets toolkit. It is a Python interface for Qt, one of the most powerful, and popular cross-platform GUI library. PyQt was developed by RiverBank Computing Ltd. The latest version of PyQt can be downloaded from its official website − riverbankcomputing.com
PyQt API 是一套包含大量类和函数的模块。其中 QtCore 模块包含用于处理文件、目录等的非 GUI 功能, QtGui 模块包含所有图形控制。此外,还有用于处理 XML (QtXml) 、SVG (QtSvg) 和 SQL (QtSql) 等的模块。
PyQt API is a set of modules containing a large number of classes and functions. While QtCore module contains non-GUI functionality for working with file and directory etc., QtGui module contains all the graphical controls. In addition, there are modules for working with XML (QtXml), SVG (QtSvg), and SQL (QtSql), etc.
以下是常用模块的列表 −
A list of frequently used modules is given below −
-
QtCore − Core non-GUI classes used by other modules
-
QtGui − Graphical user interface components
-
QtMultimedia − Classes for low-level multimedia programming
-
QtNetwork − Classes for network programming
-
QtOpenGL − OpenGL support classes
-
QtScript − Classes for evaluating Qt Scripts
-
QtSql − Classes for database integration using SQL
-
QtSvg − Classes for displaying the contents of SVG files
-
QtWebKit − Classes for rendering and editing HTML
-
QtXml − Classes for handling XML
-
QtWidgets − Classes for creating classic desktop-style UIs
-
QtDesigner − Classes for extending Qt Designer
Supporting Environments
PyQt 与所有流行的操作系统兼容,包括 Windows、Linux 和 Mac OS。它采用双重许可证,既有 GPL 也提供商业许可证。最新稳定版本是 PyQt5-5.13.2. 。
PyQt is compatible with all the popular operating systems including Windows, Linux, and Mac OS. It is dual licensed, available under GPL as well as commercial license. The latest stable version is PyQt5-5.13.2.
Windows
提供了与 Python 3.5 或更高版本兼容的 32 位或 64 位架构的文件轮。推荐使用 PIP 实用程序进行安装 −
Wheels for 32-bit or 64-bit architecture are provided that are compatible with Python version 3.5 or later. The recommended way to install is using PIP utility −
pip3 install PyQt5
要在 Linux/macOS 上从源代码 www.riverbankcomputing.com/static/Downloads/PyQt5 构建 PyQt5,请使用以下命令 −
To install development tools such as Qt Designer to support PyQt5 wheels, following is the command −
pip3 install pyqt5-tools
您还可以在 Linux/macOS 上从 www.riverbankcomputing.com/static/Downloads/PyQt5 构建 PyQt5。
You can also build PyQt5 on Linux/macOS from the source code www.riverbankcomputing.com/static/Downloads/PyQt5