pyqt-threading

Installation
SKILL.md

PyQt Threading - Concurrency and Thread Safety

Comprehensive guide to threading in PyQt applications.

Thread Safety Rules

CRITICAL: Qt/PyQt is NOT thread-safe for UI operations. You MUST follow these rules:

  1. Never access widgets from worker threads - Only the main thread can modify UI
  2. Use signals for cross-thread communication - Emit signals from worker, connect to slots in main thread
  3. Use Qt.QueuedConnection for thread-safe signal delivery - AutoConnection handles this automatically
  4. Never block the main thread - Long operations will freeze the UI
# ❌ WRONG: Direct UI access from thread
class BadWorker(QThread):
    def run(self):
        # This will crash or cause undefined behavior!
        self.label.setText("Done")
Installs
8
GitHub Stars
7
First Seen
Apr 20, 2026
pyqt-threading — codeatcode/oss-ai-skills