gitmyhub

PyQt

Python ★ 7.1k updated 5mo ago

PyQt Examples(PyQt各种测试和例子) PyQt4 PyQt5

A collection of ready-to-run example scripts for PyQt5 and PyQt4 covering widgets, layouts, charts, 3D plots, threading, and web views so you can copy, run, and learn each GUI feature one at a time.

PythonPyQt5PyQt4QtQMLsetup: moderatecomplexity 2/5

This repository is a collection of working example scripts for PyQt4 and PyQt5, the Python bindings for the Qt graphical user interface framework. Qt is a system for building desktop applications with windows, buttons, menus, charts, and other visual components. Each script in the repo demonstrates one specific widget or feature so you can copy it directly, run it, and see the result.

The collection covers a wide range of Qt components. Layout examples show how to arrange controls vertically, horizontally, and in grids with spacing and proportional sizing. Button examples include animated buttons, progress overlays, and rubber-band effects. List, tree, and table widgets are demonstrated with JSON data sources, drag-and-drop behavior, sorting, and embedded custom widgets. There are also examples for scroll areas, tabs, stacked panels, combo boxes with linked dropdowns, sliders with click-to-jump behavior, and various progress bar styles including circular, water-wave, and colourful animated variants.

Chart examples cover line charts, bar charts, pie charts, scatter plots, stacked variations, and a live CPU monitoring chart. Three-dimensional data visualization examples include bar charts and surface plots. Web view examples show how to embed a browser widget, interact with JavaScript, intercept network requests, and capture screenshots of web pages.

Threading examples cover the two common patterns for running background work in PyQt: subclassing QThread and moving objects between threads. There are also examples for QML integration and for connecting Python code to a web page through Qt's WebChannel bridge.

The accompanying website at pyqt.site is a Chinese-language community forum where contributors share notes and solutions gathered from their own learning. A custom widget library and a standalone PyQt client application are listed as related projects in the repository.

Where it fits