qtqml

Define Qt QML conventions for C++ type exposure and module organization.

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/dotBeeps/pantry --skill qtqml
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: qtqml
Source: https://github.com/dotBeeps/pantry/tree/main/morsels/skills/qtqml
Command: npx skills add https://github.com/dotBeeps/pantry --skill qtqml

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Centralizes and codifies Qt QML conventions, ensuring consistent type exposure and module usage across projects.

Core Features & Use Cases

  • Establishes recommended practices for QML type registration (QML_ELEMENT, QML_SINGLETON), properties (Q_PROPERTY with FINAL), and lightweight value types (QML_GADGET, QML_VALUE_TYPE).
  • Guides module organization and versioning for scalable QML modules; helps teams structure qmldir and imports across C++ backends.
  • Provides concrete examples and rules to avoid common pitfalls when exposing C++ to QML and when configuring QML modules.

Quick Start

Apply these conventions to your Qt project to ensure correct QML exposure and module configuration.

Frequently Asked Questions about qtqml

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I expose a C++ backend to QML using QML_ELEMENT and Q_PROPERTY?

Expose C++ backend types to QML by applying QML_ELEMENT for registration and configuring Q_PROPERTY with FINAL to ensure correct property semantics and robust QML-C++ integration.

What is the best way to organize a qmldir file for scalable QML modules?

Organizing a qmldir file for scalable QML modules requires defining module structure, versioning, and QML imports correctly to maintain consistent type exposure across C++ backends.

When do I need QML_SINGLETON versus QML_GADGET in Qt QML?

Use QML_SINGLETON to expose singleton patterns and QML_GADGET or QML_VALUE_TYPE for lightweight value types when defining QML type registration to ensure correct QML exposure.

Why does my QML type registration fail when importing a C++ module?

QML type registration fails when module structure and versioning rules are misconfigured, requiring correct qmldir maintenance and proper QML_ELEMENT usage to expose C++ types.

Can I use Qt QML conventions for projects without C++ backends?

Qt QML conventions are applicable to projects using QML with C++ backends, focusing on C++ interop, module organization, and type exposure rather than standalone QML application design.