qt-qml-test

Generates Qt Quick Test cases for QML components using TestCase and SignalSpy.

1|Updated Jul 12, 2026
One-click install
npx skills add https://github.com/TypeThe0ry/Multi-Detect --skill qt-qml-test-typethe0ry
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: qt-qml-test
Source: https://github.com/TypeThe0ry/Multi-Detect/tree/main/ground-control/MultiDetectGCS/tools/skills/qt-qml-test
Command: npx skills add https://github.com/TypeThe0ry/Multi-Detect --skill qt-qml-test-typethe0ry

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing Qt Quick Test unit tests for QML components by hand is repetitive and error-prone, with many subtle pitfalls such as invisible TestCase parents, interactive-only signals, and offscreen sizing issues. This Skill reads your QML source files and generates correct, convention-compliant tst_*.qml test files automatically. ## Core Features & Use Cases - Automated test generation: Produces one tst_<ComponentName>.qml per source QML file using a canonical template with Item wrapper, Component block, and TestCase lifecycle. - 47-rule contract: Applies consolidated rules covering imports, SignalSpy patterns, mouse and key events, per-control specifics (Button, TextField, Slider, SpinBox, Dial, Dialog, MenuItem, Image, MouseArea, TapHandler), Window and singleton sources, and Qt Quick 3D skip handling. - Bounded project context: Reads only the source, its direct custom-component imports, qmldir, and the nearest CMakeLists.txt to resolve the correct source import. - Use Case: Point the Skill at app/forms/LoginForm.qml and it writes tests/tst_LoginForm.qml with property round-trips, SignalSpy-based signal verification, and mouse-driven interaction tests, ready to run with qmltestrunner or CTest. ## Quick Start Ask your AI assistant to write Qt Quick Tests for a specific QML file or directory, for example: generate Qt Quick Tests for widgets/MyButton.qml.

Frequently Asked Questions about qt-qml-test

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

FAQPage Schema
How do I generate Qt Quick Test cases for QML components?▼

Provide the path to a QML file or directory and ask for Qt Quick Tests. The Skill reads the source, applies 47 testing rules covering TestCase structure, SignalSpy, and mouse events, then writes one tst_<ComponentName>.qml per source under tests/.

What Qt Quick Controls can be tested with SignalSpy?▼

SignalSpy patterns are provided for Button, Slider, SpinBox, Dial, Dialog family, MenuItem, MouseArea, TapHandler, HoverHandler, and Accessible signals. Interactive-only signals like Slider.moved and SpinBox.valueModified are driven with real mouse or key events, not property assignment.

Does this work with Qt 5 or only Qt 6?▼

The generated tests target Qt 6. The canonical template imports QtQuick and QtTest without version numbers, which requires Qt 6; Qt 5 projects would need versioned imports and are not the intended target.

Can it build and run the generated QML tests?▼

No, building and running is out of scope. Use the qt-qml-test-run companion skill, which wires up CMake test infrastructure and executes tests via CTest or qmltestrunner, then writes a Markdown report.

Why does findChild fail to reach inner items in my QML?▼

QML ids are document-scoped, so a sibling test file can only resolve children by objectName. The Skill offers to add objectName declarations matching existing ids; otherwise it skips those assertions and lists each unreached item.

What are the limitations for Window and Qt Quick 3D sources?▼

Window and ApplicationWindow sources use Qt.createComponent plus createObject instead of createTemporaryObject, and singletons are accessed by name. Qt Quick 3D graphical-node sources like Model, Node, cameras, and lights are skipped entirely.