Welcome to LearnPyQt — the complete guide to building GUI apps with Python & Qt.
Learn how to use PyQt5 to create desktop applications with Python. Rapidly convert your scripts and utilities into professional apps, which you can share with others.
There are two Python libraries for using Qt from Python — PyQt and PySide. Both give you all the power of the Qt5 framework directly from Python, including complex widgets, multimedia support, 2D vector graphics and a flexible model-view architecture.
This complete PyQt5 tutorial takes you from basic principles to complex applications, including multithreading and model views. We also have a library of example apps and custom widgets to use in your own projects.
PyQt5 not installed? Check out the installation guides for Windows, Linux and Mac.
Getting started with PyQt5
Take your first steps building apps with Python & Qt5
Like writing any code, building PyQt5 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.
-
Creating your first app with PyQt
(03:44)
A simple Hello World! application with Python and Qt5 -
Signals, Slots & Events
(10:00)
Triggering actions in response to user behaviours and GUI events -
Actions — Toolbars & Menus
(12:00)
Defining toolbars, menus and keyboard shortcuts with QAction -
Widgets
(20:00)
Using Qt5's library of built-in widgets to build your applications -
Layout management
(18:00)
Use layouts to effortlessly position widgets within the window -
Dialogs and Alerts
(05:00)
Notify your users and ask for their input
Creating applications with Qt Designer
Using the drag-drop designer to develop your apps
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 PyQt5 tutorial we'll cover the basics of creating Python GUIs with Qt Designer.
-
First steps with Qt Designer
(07:01)
Use Qt Designer's drag and drop interface to design your GUI -
Laying Out Your GUIs With Qt Designer
(12:52)
Use Qt Designer to effortlessly build your application UI -
Embedding custom widgets from Qt Designer
(05:12)
Learn how to use custom widgets in your PyQt5 applications when designing with Qt Designer -
Creating Dialogs With Qt Designer
(17:09)
Using the drag and drop editor to build PyQt5 dialogs -
The QResource System
(09:13)
Using the QResource system to package additional data with your applications
Extended UI features
Extending your apps with complex GUI behaviour
In this PyQt5 tutorial we'll cover some advanced features of Qt that you can use to improve your Python GUIs.
-
System tray & Mac menu bar applications
(03:45)
Add quick access functions to your apps -
Add scrollable regions with QScrollArea
(06:27)
Run out of space in your GUI? Add a scrollable region to your application -
Creating searchable widget dashboards
(16:04)
Make dashboard UIs easier to use with widget search & text prediction -
Transmitting extra data with Qt Signals
(08:03)
Modifying widget signals to pass contextual information to slots -
Creating additional windows
(12:07)
Opening new windows for your application
Mozzarella Ashbadger
Build your own tabbed web browser with PyQt5
Now we've learnt the basics, we'll put it into practice building a real-life app. In this course we'll create a functional web browser using Qt5 widgets. Starting with the basics and then gradually extending it to add features like opening and saving pages, help, printing and tabbed browsing. Follow the tutorial step by step to create your own app, but feel free to experiment as you go.
-
Mozzerella Ashbadger
(06:00)
The first steps building the browser with PyQt5 -
Adding navigational controls to a PyQt5 Web Browser
(15:00)
Hook up QAction signals to web browser slots -
Open and save HTML in a PyQt5 browser
(07:00)
Adding file dialogs to load and save HTML -
Adding application Help and About dialogs
(11:00)
Put some finishing touches to your application -
Tabbed web browsing
(18:00)
Use signal redirection to add a multi-tab interface
Threads & Processes
Run concurrent tasks without impacting your UI
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 PyQt5 tutorial we'll cover how to avoid this happening and keep your applications running smoothly, no matter the workload.
ModelViews and Databases
Connecting your application to data sources
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 PyQt5 tutorial we'll discover how you can use Qt ModelViews to build high performance Python GUIs.
Graphics and Plotting
Vector graphics and plotting using PyQtGraph
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 PyQt5 tutorial we'll introduce vector graphics and have a look at plotting data with PyQtGraph.
Custom Widgets
Designing your own custom widgets in PyQt
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
how the QPainter
system works and what you can do with it. In this PyQt5 tutorial we'll go
from basic bitmap graphics to our own entirely custom widget.
-
QPainter and Bitmap Graphics
(15:47)
Introduction to the core features of QPainter -
Creating custom GUI widgets in PyQt5
(22:52)
Build a completely functional custom widget from scratch using QPainter -
Animating custom widgets with QPropertyAnimation
(18:17)
Add dynamic visual effects to your custom widgets
Packaging and distribution
Sharing your awesome applications with other people
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 PyQt5 tutorial we'll cover how to package up your apps to share, whether commercially or just for fun.
QtQuick & QML
Building modern GUIs with QtQuick & QML
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.
Create your Learn PyQt account to track progress.
If you've finished the entire tutorial you're basically a PyQt genius! But keep checking back as I'm adding new tutorials regularly. If you have something in particular you would like to see covered on the course drop me an email.
Your Books & Downloads
Here are your purchased books & other resources. You may download new copies (and share them) as often as you like.
- [[ collection_name ]]
Your account gives you access to any future updates.
Upgrade to get access to access video.
If you buy the PyQt5 book (or the PySide2 edition or PySide6 edition) your downloads will be available here. You'll have lifetime access to any future updates and additions.



PyQt5 Example Apps
What can I make with PyQt5?
If you're interested to see what's possible with Python GUIs I've created a series of example apps. These include clones of classic desktop applications including Solitaire, Minesweeper, a desktop Calculator and Notepad. See more example Apps