Python GUI FAQ

Common Python GUI Questions, Answered

Answers to our users most frequently answered questions, from licensing, packaging and libraries, to PyQt tips and tricks.

Showing articles for All (282) PyQt6 (107) PySide6 (15) PyQt5 (68) Streamlit (0) Tkinter (1) PySide2 (6) Kivy (0)

QWidget::setLayout: Attempting to set QLayout on a widget which already has a layout

Understanding why calling setLayout() twice causes an error, and how to structure your layouts correctly

Fixing inotify_add_watch errors when deleting files with QFileSystemModel

Why Qt's file watcher complains about deleted directories and how to handle it

AttributeError type object 'Qt' has no attribute 'Alignment'

Understanding enum naming changes in PyQt6.1 and how to fix alignment flags

Why selectRow After insertRow Doesn't Work in PyQt6

Understanding how to properly insert rows in a QAbstractTableModel and select them in a QTableView

Writing a PyQt5 Plugin in QGIS — Reading a ComboBox Value

How to check which item a user selected in a QComboBox and run different code depending on the choice

Raspberry Pi 4 QMediaPlayer Audio Output via Analog Jack

Getting PyQt5 QMediaPlayer audio to play through the 3.5mm headphone jack on Raspberry Pi

Navigating QSqlTableModel and QTableView in very large databases

Working with large datasets in Qt's SQL table views, handling pagination, filtering, and record navigation

Problems with antivirus software and PyInstaller

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

Monitoring a Running Background Process from a PyQt6 Application

How to connect your GUI to an external program that's already running

Display Data with Different Column Sizes in a QAbstractTableModel

How to handle jagged or uneven row lengths when displaying file data in a QTableView

Constantly Print Subprocess Output While Process is Running

How to stream live output from a subprocess into your PyQt6 GUI without freezing the interface

Waiting for Multiple Threads to Complete Before Starting Another in Qt

How to coordinate dependent background tasks using QThreadPool and signals

Avoid gray background for selected icons

Create a custom ToggleButton widget to replace QAction checkable icons without the default gray selection background

Packaging PySide6 and PyQt6 Apps with PyInstaller

Solving the missing Qt platform plugin error when building executables

Creating Grouped and Stacked Bar Charts with PyQtGraph

Build professional grouped and stacked bar charts in your PyQt6 applications using pyqtgraph's BarGraphItem

QSqlRelationalTableModel, QSortFilterProxyModel and QDataWidgetMapper

How to correctly combine relational models, proxy models, and data widget mappers in PyQt6

Managing Multiple QRunnables with a Launcher QRunnable in PyQt6

How to coordinate parallel tasks and add stop functionality using QThreadPool

Combo Box delegate disappears with QSortFilterProxyModel applied

Why your QTableView delegate vanishes when you add a proxy model, and how to fix it

How to Clear and Refresh ComboBox Delegate Data in QTableView

Keep your QTableView ComboBox delegates in sync when your underlying data changes

Displaying NumPy Arrays and Pandas Data in QTableView Cells

How to handle complex data like NumPy arrays and Pandas Series inside a QAbstractTableModel

How to Show Only Icons in QTableView Cells (Hide Text)

Use custom model roles to display icons without text in your PyQt5 tables

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

Deploying PyQt6 Apps on macOS with py2app

How to package your PyQt6 application into a standalone macOS .app bundle
1 2 3 4 5 6 7 8 9 10 11 12