Create GUI Applications with PyQt6

Want to create Python GUIs? Here is everything you need to go from simple UIs to complete apps with PyQt6.

Building GUI applications with Python doesn't have to be difficult. In this tutorial I'll walk you step by step from simple Python GUIs to real useful apps.

By the end of the tutorial you'll be able to make your own applications, design professional UIs and even create installers and packages to share your apps with other people.

PyQt6 is a Python GUI framework for creating GUI applications using the Qt toolkit. Created by Riverbank Computing, PyQt is free software (GPL licensed) and has been in development since 1999. The latest version PyQt6 was released in 2021.

This tutorial requires some basic Python knowledge, but no experience with GUI programming.

Take your first steps creating Python GUI applications with these simple step-by-step guides to Python & Qt.

PyQt6 not installed? See our installation guides for Windows, macOS and Linux

Once you're set up you can get started by Creating your first GUI application with Python.

Where do I begin with PyQt6?

Creating your first app with PyQt6

A simple Hello World! application with Python and Qt6

Install PyQt6 on Ubuntu Linux

Install PyQt6 on Ubuntu and other Debian-based Linux distributions

Install PyQt6 on macOS

Step-by-step guide to installing PyQt6 on macOS for Python GUI development

Now you have made your first GUI app, let's go a step further adding widgets and layouts to build some simple Python UIs.

Learn the fundamentals of PyQt6

Creating Additional Windows in PyQt6

How to open, show, hide and toggle multiple windows in your PyQt6 application

PyQt6 Toolbars & Menus — QAction

Defining toolbars, menus, and keyboard shortcuts with QAction

PyQt6 Dialogs and Alerts

Notify your users and ask for their input

So far we have been creating apps using Python code. This works well in many cases, but it can get a bit cumbersome to define all widgets programmatically. The good news is that Qt comes with a graphical editorQt Designer — which provides a drag-and-drop UI editor. Using Qt Designer, we can define our UIs visually and then simply hook up the application logic later.

If you're upgrading from PyQt5, note that the Qt resource system (including QResource) is not available in PyQt6.

Using Qt Designer with PyQt6

Install Qt Designer Standalone

Qt Designer Download for Windows, Mac and Linux

Embedding Custom Widgets from Qt Designer in PyQt6

Learn how to use custom widgets in your PyQt6 applications when designing with Qt Designer

Creating Dialogs With Qt Designer and PyQt6

Using the drag and drop editor to build PyQt6 dialogs

Most Python apps need to interact with data sources — whether that's a CSV file, database or remote APIs. One of the main benefits of using Python to build applications is being able to make use of Python's data science tools to process and analyse data.

With PyQt6 you can make use of Qt's model view architecture to display performant views of any Python data in your applications. Or embed matplotlib and PyQtGraph plots for dynamic visualizations.

If you're using Qt Designer to create your applications, take a look at how to use PyQtGraph & Matplotlib widgets inside Qt Designer.

PyQt6 for Data Science

Plotting With PyQtGraph and PyQt6

Create Custom Plots in PyQt6 With PyQtGraph

Plotting With Matplotlib and PyQt6

Create PyQt6 plots with the popular Python plotting library

Embedding Custom Widgets from Qt Designer in PyQt6

Learn how to use custom widgets in your PyQt6 applications when designing with Qt Designer

Building real applications, you'll find yourself wanting to perform long-running tasks. For example, your application might need to interact with remote APIs or perform complex calculations.

But you'll notice a problem: while the long-running task completes, your app will become unresponsive. Your code blocks Qt from running until it returns.

In these tutorials we'll discover how to use threads & processes to long-running tasks while keeping your app responsive.

PyQt6 Concurrency

Using QProcess to Run External Programs in PyQt6

Run background programs without impacting your UI

Waiting for Multiple Threads to Complete Before Starting Another in Qt

How to coordinate dependent background tasks using QThreadPool and signals

Multithreading PyQt6 applications with QThreadPool

Run background tasks concurrently without impacting your UI

Qt comes with a large library of widgets built-in. But sometimes your applications need something different. In PyQt6 you can you design your own widgets, drawing them directly in your application.

In these tutorials we'll go through the basics of drawing graphics in Qt to building your own entirely custom widget.

PyQt6 Custom Widgets

Animating Custom Widgets With QPropertyAnimation in PyQt6

Add dynamic visual effects and smooth animations to your custom PyQt6 widgets

Creating Custom GUI Widgets in PyQt6

Build a completely functional custom widget from scratch using QPainter

QPainter and Bitmap Graphics in PyQt6

Introduction to the core features of QPainter

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 these guides will walk you through the process step by step.

Packaging PyQt6 Apps by Platform

Packaging & Distributing PyQt6 Applications

Packaging PyQt6 applications for Windows with PyInstaller & InstallForge

Turn your PyQt6 application into a distributable installer for Windows

Running Python script with QProcess after freeze

How to bundle and run external Python scripts from a frozen PyQt6 application

Problems with antivirus software and PyInstaller

Why antivirus tools flag PyInstaller executables and what you can do about it

PyQt6 has two APIs for building GUIs. We've already introduced the Qt Widgets API which is well-suited for building desktop applications. Qt also provides a declarative API in the form of Qt Quick/QML. Qt Quick is well suited for building modern touchscreen interfaces for microcontrollers or device interfaces.

Books

Hands-on guides to Python GUI programming

Books taking you from first principles to fully-functional apps, not toy examples.

See all Python GUIs books

Latest Updates

Fixing Missing Icons in PyInstaller-Packaged PyQt6 Applications on Windows

Why your app icon disappears after packaging and how to fix it

Adding QComboBox to a QTableView and getting/setting values after creation

Use QItemDelegate to embed combo boxes in your table views, with per-row data and value tracking

How to Add Custom Widgets to Qt Designer

Use widget promotion to integrate your own Python widgets into Qt Designer layouts

Actions in one thread changing data in another

How to communicate between threads and windows in PyQt6

Saving and Restoring Application Settings with QSettings in PyQt6

Learn how to use QSettings to remember user preferences, window sizes, and configuration options between sessions

How can I enable editing on a QTableView in PyQt6?

Modifying your model to allow editing of your data source

More articles