Pyqt Core logo

Pyqt Core

Organization
CodeAtCode
pyqt-core

Use when working with PyQt/PySide6 QtCore - signals, slots, properties, timers, settings, file I/O

Overview

PublisherCodeAtCode
Repositoryoss-ai-skills
Skill namepyqt-core
Stars
30
Forks
3
Bundled files
4
LicenseGPL-3.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by CodeAtCode on GitHub. Read the source before you install it.

Installation

Install the Pyqt Core AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/CodeAtCode/oss-ai-skills/tree/master/frameworks/pyqt/core
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/CodeAtCode/oss-ai-skills.git /tmp/oss-ai-skills
mkdir -p .claude/skills
cp -r /tmp/oss-ai-skills/frameworks/pyqt/core .claude/skills/pyqt-core
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Pyqt Core in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Pyqt Core on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Pyqt Core is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Objective: Use this skill to reduce missed signal/slot connections, wrong connection-type crashes, QSettings scope mismatches, and timer leak incidents by enforcing connection-type rules for cross-thread communication, queue-aware patterns for worker threads, scope discipline for QSettings groups/arrays, and timer lifecycle checks with parent ownership.

PyQt Core - QtCore Module

QtCore provides core non-GUI functionality: signals/slots, timers, settings, and file I/O.

Critical Rules (Do X Because Y)

1. Use QueuedConnection for Cross-Thread Signals

Do use Qt.QueuedConnection when emitting signals from worker threads to UI slots because direct connections execute in the emitter's thread, causing crashes when slots access thread-unsafe UI objects.

python
from PySide6.QtCore import Qt, QObject, Signal, QThread

class Worker(QThread):
    dataReady = Signal(dict)  # Declared in worker thread
    
    def run(self):
        data = self.expensiveOperation()
        self.dataReady.emit(data, Qt.QueuedConnection)  # Queue to UI thread

class MainWindow(QWidget):
    def setupWorker(self):
        self.worker = Worker()
        self.worker.dataReady.connect(self.handleData, Qt.QueuedConnection)
        self.worker.start()

Failure mode: Segmentation fault or Qt runtime error "QMetaObject::invokeMethod: Unable to unmarshal value" when DirectConnection crosses thread boundary.

2. Block Signals During Batch Updates

Do call blockSignals(True) before batch updates because each signal emission triggers connected slots, causing redundant processing and performance degradation.

python
def populateTable(self, items):
    self.table.blockSignals(True)
    try:
        self.table.setRowCount(len(items))
        for i, item in enumerate(items):
            self.table.setItem(i, 0, QTableWidgetItem(item))
    finally:
        self.table.blockSignals(False)

Failure mode: Slot called N times for N row additions instead of once after batch complete.

3. Use Parent Ownership for Timers

Do pass parent to QTimer(parent) because parent ownership ensures automatic cleanup on widget destruction, preventing timer leaks and crashes from dangling timer references.

python
class MyWidget(QWidget):
    def __init__(self):
        super().__init__()
        self.timer = QTimer(self)  # Self is parent - auto-cleanup
        self.timer.timeout.connect(self.onTimeout)

Failure mode: Timer continues firing after widget destroyed → crash on slot access.

4. Provide Defaults When Reading Settings

Do provide default values in settings.value(key, default) because missing keys return None without defaults, causing type errors downstream.

python
# Safe - returns int 12 if key missing
font_size = settings.value("editor/fontSize", 10, type=int)

# Unsafe - returns None if missing, crashes on int comparison
font_size = settings.value("editor/fontSize")  # type: ignore

Failure mode: TypeError: '>' not supported between instances of 'NoneType' and 'int'.

5. Use IniFormat for Portable Settings

Do use QSettings.IniFormat for cross-platform config files because NativeFormat stores in platform-specific locations (Windows registry, macOS plist), making settings non-portable.

python
# Portable - same file on all platforms
settings = QSettings("config.ini", QSettings.IniFormat)

# Platform-specific - different storage per OS
settings = QSettings("MyCompany", "MyApp")  # Native format

Failure mode: Settings appear "lost" when moving between platforms or after OS reinstall.

6. End Groups/Arrays in Finally Blocks

Do wrap beginGroup/endGroup and beginWriteArray/endArray in try-finally because exceptions leave settings in incomplete state, corrupting the file.

python
def saveSettings(self):
    settings = QSettings("config.ini", QSettings.IniFormat)
    try:
        settings.beginGroup("editor")
        settings.setValue("fontSize", 12)
        settings.endGroup()
    finally:
        settings.endGroup()  # Ensures cleanup even on error

Failure mode: Corrupted INI file with unclosed groups preventing future reads.

7. Stop Timers Before Destruction

Do explicitly stop timers in closeEvent because while parent ownership handles cleanup, stopping timers prevents late emissions during destruction sequence.

python
def closeEvent(self, event):
    self.timer.stop()  # Stop before parent cleanup
    super().closeEvent(event)

Failure mode: Timer fires during widget teardown → slot accesses destroyed objects.

8. Check File Existence Before Operations

Do check QFile.exists() before read operations because open() silently fails on missing files, causing data loss if write mode is used accidentally.

python
if QFile.exists("data.txt"):
    file = QFile("data.txt")
    if file.open(QIODevice.ReadOnly):
        data = file.readAll()
        file.close()
else:
    logger.warning("Data file not found, using defaults")

Failure mode: Silent data loss when file missing and code proceeds with empty data.

Signal/Slot Reference

See references/signals-slots.md for complete signal declaration, slot declaration, and connection syntax.

QTimer Reference

See references/timers.md for complete timer API including single-shot, periodic, and timer properties.

QSettings Reference

See references/settings.md for complete settings API including groups, arrays, and format options.

File I/O Reference

See references/file-io.md for complete file operations including QFile, QTextStream, and QDir.

Deep Dives

  • references/signals-slots.md - Signal/slot syntax, connection types, best practices
  • references/timers.md - QTimer API, single-shot vs periodic, timer types
  • references/settings.md - QSettings API, groups, arrays, formats
  • references/file-io.md - QFile, QTextStream, QDir operations

References

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Pyqt Core AI skill do?

Use when working with PyQt/PySide6 QtCore - signals, slots, properties, timers, settings, file I/O

Why use Pyqt Core on TypingMind?

Because you install it once and use it with any model. Pyqt Core is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Pyqt Core in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/CodeAtCode/oss-ai-skills/tree/master/frameworks/pyqt/core. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Pyqt Core?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Pyqt Core?

As many as you like. As long as a model supports skills, you can use Pyqt Core with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Pyqt Core AI skill free?

Yes. It is published on GitHub by CodeAtCode under the GPL-3.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇