Skip to content

Add python-pyqt-qthread materials folder - #1003

Open
realpython-bot wants to merge 1 commit into
masterfrom
maintenance/python-pyqt-qthread-20261204
Open

realpython-bot wants to merge 1 commit into
masterfrom
maintenance/python-pyqt-qthread-20261204

Conversation

@realpython-bot

Copy link
Copy Markdown
Collaborator

Adds the companion code for Use PyQt's QThread to Prevent Freezing GUIs. The code follows the PyQt6 update draft (Post 2476, admin: https://realpython.com/pbjt/blog/post/2476/change/). Card: https://trello.com/c/d1TnrYBL

Files: freezing_gui.py, responsive_gui.py, qrunnable_example.py, account_manager.py, and a README. requirements.txt pins PyQt6==6.12.1, the same pin as the draft. freezing_gui.py and qrunnable_example.py are the article's complete listings. The other two scripts are built from the article's snippets. All files are formatted with ruff.

How it was verified: Python 3.15.2 with PyQt6 6.12.1 (Qt 6.12.0) in a fresh venv built from requirements.txt, using QT_QPA_PLATFORM=offscreen. Each GUI was driven by timers and clicks:

  • The freezing GUI blocks for 5 s.
  • The responsive GUI stays live and resets when the task ends.
  • The QRunnable runnables keep going after the event loop quits.
  • The account manager never goes negative.

ruff@0.14.1 format/check and dircheck.py all pass.

🤖 Generated with Claude Code

Code examples for the PyQt6 update of "Use PyQt's QThread to Prevent Freezing GUIs".

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant