Basti's Scratchpad on the Internet
20 Mar 2020

Qt for Python Video Tutorial

This video series was produced in the spring of 2020, during the COVID19-pandemic, when all lectures had to be held electronically, without physical attendance. It is a tutorial, in German, for building a small Qt GUI that visualizes the ongoing pandemic on a world map.

If the videos are too slow, feel free to speed them up by right-clicking, and adjusting play speed (Firefox only, as far as I know).

You may also download the videos and share them with your friends. Please do not upload them to social media or YouTube, but link to this website instead. If you want to modify them or create derivative works, please contact me.

Creative Commons License
The Qt for Python Video Tutorial by Bastian Bechtold is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

Update: As of April 2022, all code examples have been updated to use PySide6. In particular, this changes the imports, replaces app.exec_() with app.exec(), and replaces mouseEvent.pos() with mouseEvent.position().toPoint() (see note in

1 Intro

Prerequisites: A basic understanding of Python, and a working installation of python ≥3.4.

An overview over the topics discussed in the rest of the videos, and installation of Qt for Python and Pandas.

2 Hello World

Our first GUI program, a window with a text label.


3 Main Window

Create a QMainWindow, and build some structure for later episodes.


4 Layouts

Position a QLabel and a QPushButton side by side, using layouts.


5 Signals and Slots

Make the button change the label's text if clicked.


6 Loading Data

Load the data required to draw a map.


Data: countries_110m.json

7 Drawing the Map

Draw a world map into a QGraphicsScene.


8 Pens and Brushes

Make the map pretty, using QPens and QBrushes.


9 Resize Event

Resize the map when the window size changes, by overloading resizeEvent.


10 Mouse Tracking

Highlight the country under the mouse.


11 Custom Signal

Respond to clicks of a country.


12 Addendum

Improve the code by cutting out a middle man.


13 Pandas

A quick introduction to Pandas.

Data: covid19.csv

14 Pandas Integration

Load the COVID19 dataset and print some stats.


15 Model View Tables

Display the COVID19 dataset in a QTableView.


16 Table Header Data

Fill in the table headers from the dataset.


17 Country Selection

Show only a subset of the dataset when a country is clicked.


18 Cleanup

Summary, and a few finishing touches.


Tags: programming python
Other posts
Creative Commons License by Bastian Bechtold is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.