This repository contains simple getting started examples to develop Qt applications in Python using PySide6. It is intended for educational purposes and self study:
- Basic Python knowledge recommended.
- No experiences with Qt or PySide required.
- A computer to run / test the examples.
PySide6 is the official Qt for Python
module, which provides access to the
complete Qt 6.0+ framework. It is available under both Open Source
(LGPLv3/GPLv2) and commercial license. Using PyPi (PIP) is the recommended
installation source.
- 00 Qt Core
- 01 Getting Started
- 02 Messagebox
- 03 Layout Management
- 04 Menu's and Toolbars
- 05 Events and Signals
- 06 Dialogs
- 07 Widgets
- 08 Widgets Specifics
- 09 Wizard
- 10 Drag and Drop
- 11 Drawing
- 12 Custom Widgets
- 13 Qt Creator
- 14 System tray
- 15 Miscellaneous
- 16 Games
- 17 Desktop Applications
- 18 Deployment
- 19 Tables
A separate PySide6 deployment project for Windows / Linux using Nuitka on Github Actions is available here.
- Linux setup
- Windows setup
- MAC setup: Not supported by developer Erriez.
- Debug with free PyCharm (On Windows and Linux desktops)
Examples are tested with PySide 6.7.2 on Ubuntu 22.10 Wayland and Windows 10/11. As Qt is platform independent, it may work on other systems like Raspberry Pi. See section Known issues for platform specific issues.
The following Qt
/ PySide6
/ Qt Creator
bugs are reported and affects
examples in this repository:
- QTBUG-110119: Cannot move
window on Ubuntu Wayland.
- Moving the top window on (Ubuntu) Wayland with widget functions
move()
andsetGeometry()
are not supported by Qt / PySide6. - Window move works on X11 and Windows 10.
- Other desktop GUI's such as TKinter are able to move the top window on Wayland.
- QTBUG-86780: Documentation update requested.
- Moving the top window on (Ubuntu) Wayland with widget functions
- QTBUG-110290: QWidget
showNormal()
not working when window is minimized on Ubuntu X11 and Wayland. - QTBUG-110448: Cannot remove window min/max buttons on Ubuntu Wayland.
- QTBUG-132337: Removing window min/max buttons on Windows 11 also removes close button
- QTCREATORBUG-25807: PySide6 generated class doesn't load UI file correctly with QtCreator.
- Example
13_qt_creator\01_qt_creator_qwidget.py
generates a warning:Attribute Qt::AA_ShareOpenGLContexts must be set before QCoreApplication is created.
Unclear how to resolve this. - Be aware that a large number of official PySide6 examples are currently outdated or API documentation is incomplete or inconsistent.