PySide, also known as Qt for Python, is a Python library for creating GUI applications using the Qt toolkit. PySide is the official binding for Qt on Python and is now developed by The Qt Company itself.
There are two major versions available: PySide2 based on Qt5 and PySide6 based on Qt6. Both versions are almost completely compatible aside from imports, and lack of support for some advanced modules in Qt6.
In this tutorial we'll learn how to use PySide to create desktop applications with Python.
This course includes 28 tutorials.
Like writing any code, building PySide applications is all about approaching it in the right way. In the first part of the course we cover the fundamentals necessary to get you building Python GUIs as quickly as possible. By the end of the first part you'll have a running
QApplication which we can then customize.
Take your first steps building Python & Qt5 apps with PySide
Creating your first app with PySide
A simple Hello World! application with Python and Qt
Signals, Slots & Events
Triggering actions in response to user behaviors and GUI events
Using PySide's built-in widgets to build your applications
Use layouts to effortlessly position widgets within the window
Actions — Toolbars & Menus
Defining toolbars, menus and keyboard shortcuts with QAction
Dialogs and Alerts
Notify your users and ask for their input
Creating additional windows
Opening new windows for your application
As your applications get larger or interfaces become more complicated, it can get a bit cumbersome to define all elements programmatically. The good news is that Qt comes with a graphical editor Qt Designer (or Qt Creator) which contains a drag-and-drop UI editor — Qt Designer. In this PySide tutorial we'll cover the basics of creating Python GUIs with Qt Designer.
Using the drag-drop designer to develop your PySide apps
First steps with Qt Designer
Use Qt Designer's drag and drop interface to design your GUI
Laying Out Your GUIs With Qt Designer
Use Qt Designer to effortlessly build your application UI
Embedding custom widgets from Qt Designer
Learn how to use custom widgets in your PySide applications when designing with Qt Designer
Creating Dialogs With Qt Designer
Using the drag and drop editor to build PySide dialogs
The QResource System
Using the QResource system to package additional data with your applications
In this PySide tutorial we'll cover some advanced features of Qt that you can use to improve your Python GUIs.
Extending your PySide apps with complex GUI behaviour
System tray & Mac menu bar applications
Add quick access functions to your apps
Add scrollable regions with QScrollArea
Run out of space in your GUI? Add a scrollable region to your application
Creating searchable widget dashboards
Make dashboard UIs easier to use with widget search & text prediction
Transmitting extra data with Qt Signals
Modifying widget signals to pass contextual information to slots
As your applications become more complex you may finding yourself wanting to perform long-running tasks, such as interacting with remote APIs or performing complex calculations. By default any code you write exists in the same thread and process, meaning your long-running code can actually block Qt execution and cause your Python GUI app to "hang". In this PySide tutorial we'll cover how to avoid this happening and keep your applications running smoothly, no matter the workload.
Run concurrent tasks without impacting your PySide UI
Create GUI Applications with Python & Qt (PySide6 Edition)
The easy way to create desktop applications
Create GUI Applications is the complete guide to building GUI applications with Python. Starting from the very basics of creating a desktop window this book takes you on a tour of the key features of PySide6 you can use to build real-life applications.
To support developers in [[ countryRegion ]] I give a [[ localizedDiscount[couponCode] ]]% discount on all books and courses.
[[ activeDiscount.description ]] I'm giving a [[ activeDiscount.discount ]]% discount on all books and courses.
All but the simplest of apps will usually need to interact with some kind of external data store — whether that's a database, a remote API or simple configuration data. The Qt ModelView architecture simplifies the linking and updating your UI with data in custom formats or from external sources. In this PySide tutorial we'll discover how you can use Qt ModelViews to build high performance Python GUIs.
Connecting your PySide application to data sources
In addition to the simple bitmap graphics already covered, Qt provides API for vector graphics. Vector graphics can be used to build complex and interactive interfaces beyond the normal widget interface. They can also be used for plotting nice graphs with
PyQtGraph. In this PySide tutorial we'll introduce vector graphics and have a look at plotting data with PyQtGraph.
Vector graphics and plotting using PyQtGraph in PySide
Widgets in Qt are built on bitmap graphics — drawing pixels on a rectangular canvas to
construct the "widget". To be able to create your own custom widgets you first need to understand
QPainter system works and what you can do with it. In this PySide tutorial we'll go
from basic bitmap graphics to our own entirely custom widget.
Designing your own custom widgets in PySide
QPainter and Bitmap Graphics
Introduction to the core features of QPainter
Creating custom GUI widgets in PySide
Build a completely functional custom widget from scratch using QPainter
Animating custom widgets with QPropertyAnimation
Add dynamic visual effects to your custom widgets
There comes a point in any app's development where it needs to leave home — half the fun in writing software is being able to share it with other people. Packaging Python GUI apps can be a little tricky, but in this PySide tutorial we'll cover how to package up your apps to share, whether commercially or just for fun.
Sharing your PySide applications with other people
Qt Quick is Qt's declarative UI design system, using the Qt Modeling Language (QML) to define custom user interfaces. Originally developed for use in mobile applications, it offers dynamic graphical elements and fluid transitions and effects allowing you to replicate the kinds of UIs you find on mobile devices. Qt Quick is supported on all desktop platforms too and is a great choice for building desktop widgets or other interactive tools. Qt Quick is also a great choice for developing UIs for hardware and microcontrollers.