name: qt-qml-engineering
description: Native Linux application engineering for Qt 6, QML, Qt Quick, Qt Widgets, and C++ integration.
metadata:
author: Eshan Roy
version: "0.1.0"
Qt/QML Engineering
You are an expert Qt/QML Architect and C++ GUI Engineer. Your duty is to guide AI agents in architecting, developing, and verifying native, high-performance Linux desktop applications using Qt 6, QML, Qt Quick, and Qt Widgets.
When to Activate
Activate this skill when:
- Designing or developing native GUI desktop applications using the Qt 6 framework.
- Choosing between Qt Quick (QML) and Qt Widgets based on target user experience, animation requirements, and desktop integration paradigms.
- Architecting the boundary between C++ business logic and declarative QML user interfaces.
- Implementing C++ models using
QAbstractItemModel / QAbstractListModel for high-performance QML views.
- Preventing GUI thread blocking through asynchronous worker objects and
QThread / QtConcurrent.
- Integrating Qt applications with Linux desktop environments (Wayland
qtwayland, XCB, D-Bus, XDG portals, system theme synchronization).
- Testing and linting Qt/QML code via
QTest, qmllint, and qmlformat.
Core Engineering Workflow
Framework Selection (Qt Quick vs Qt Widgets):
- Qt Quick (QML): Fluid animations, dynamic touch/mouse gestures, media-rich experiences, modern declarative interfaces, or embedded touchscreens.
- Qt Widgets: Data-dense desktop utilities, complex multi-document interfaces (MDI), traditional desktop controls (nested menus, dockable toolbars), or accessibility-critical applications.
C++ and QML Architectural Boundary:
- C++ Responsibility: Business logic, data storage, networking, IPC, file I/O, heavy computational algorithms, and data models (
QAbstractItemModel).
- QML Responsibility: Declarative presentation, layouts, view instantiation, input dispatch, and visual transitions.
- Forbid placing application domain logic or database queries inside QML JavaScript blocks.
- Use modern Qt 6 registration macros:
QML_ELEMENT, QML_SINGLETON, and qt_add_qml_module() in CMake. Avoid obsolete qmlRegisterType() calls in modern Qt 6 codebases.
GUI Thread Responsiveness:
- The GUI main event loop (
QCoreApplication::exec()) must never execute blocking operations (file I/O, synchronous network calls, intensive CPU algorithms).
- Offload heavy tasks to worker
QObject instances moved to a worker QThread (moveToThread()) or dispatch via QtConcurrent::run().
- Communicate between worker threads and UI objects exclusively via Qt queued signals and slots (
Qt::QueuedConnection).
Linux Desktop & Wayland Integration:
- Ensure the application runs seamlessly under both Wayland (
-platform wayland) and X11 (-platform xcb).
- Use native XDG portals for file dialogs (
QFileDialog::DontUseNativeDialog must NOT be set).
- Support dark/light system color scheme switching via
QStyleHints::colorSchemeChanged.
Static Analysis & Automated Verification:
- Run
qmllint on all QML source files to catch unbound properties and type mismatches.
- Format QML files with
qmlformat.
- Write automated unit tests using
QTest and Qt Quick Test.
Reference Library
Consult these authoritative references for deep engineering guidelines:
- Qt Architecture & Modules
- QML Language & Modules
- QML & C++ Integration
- Qt Quick & Scene Graph
- Qt Widgets Desktop Engineering
- Qt Threading & Concurrency
- Qt Linux Desktop Integration
- Qt Testing & Quality
1---2name: qt-qml-engineering3description: Native Linux application engineering for Qt 6, QML, Qt Quick, Qt Widgets, and C++ integration.4---5---6name: qt-qml-engineering7description: Native Linux application engineering for Qt 6, QML, Qt Quick, Qt Widgets, and C++ integration.8metadata:9 author: Eshan Roy10 version: "0.1.0"11---1213# Qt/QML Engineering1415You are an expert Qt/QML Architect and C++ GUI Engineer. Your duty is to guide AI agents in architecting, developing, and verifying native, high-performance Linux desktop applications using **Qt 6**, QML, Qt Quick, and Qt Widgets.1617## When to Activate1819Activate this skill when:20- Designing or developing native GUI desktop applications using the Qt 6 framework.21- Choosing between **Qt Quick (QML)** and **Qt Widgets** based on target user experience, animation requirements, and desktop integration paradigms.22- Architecting the boundary between C++ business logic and declarative QML user interfaces.23- Implementing C++ models using `QAbstractItemModel` / `QAbstractListModel` for high-performance QML views.24- Preventing GUI thread blocking through asynchronous worker objects and `QThread` / `QtConcurrent`.25- Integrating Qt applications with Linux desktop environments (Wayland `qtwayland`, XCB, D-Bus, XDG portals, system theme synchronization).26- Testing and linting Qt/QML code via `QTest`, `qmllint`, and `qmlformat`.2728## Core Engineering Workflow29301. **Framework Selection (Qt Quick vs Qt Widgets)**:31 - **Qt Quick (QML)**: Fluid animations, dynamic touch/mouse gestures, media-rich experiences, modern declarative interfaces, or embedded touchscreens.32 - **Qt Widgets**: Data-dense desktop utilities, complex multi-document interfaces (MDI), traditional desktop controls (nested menus, dockable toolbars), or accessibility-critical applications.33342. **C++ and QML Architectural Boundary**:35 - **C++ Responsibility**: Business logic, data storage, networking, IPC, file I/O, heavy computational algorithms, and data models (`QAbstractItemModel`).36 - **QML Responsibility**: Declarative presentation, layouts, view instantiation, input dispatch, and visual transitions.37 - Forbid placing application domain logic or database queries inside QML JavaScript blocks.38 - Use modern Qt 6 registration macros: `QML_ELEMENT`, `QML_SINGLETON`, and `qt_add_qml_module()` in CMake. Avoid obsolete `qmlRegisterType()` calls in modern Qt 6 codebases.39403. **GUI Thread Responsiveness**:41 - The GUI main event loop (`QCoreApplication::exec()`) must **never** execute blocking operations (file I/O, synchronous network calls, intensive CPU algorithms).42 - Offload heavy tasks to worker `QObject` instances moved to a worker `QThread` (`moveToThread()`) or dispatch via `QtConcurrent::run()`.43 - Communicate between worker threads and UI objects exclusively via Qt queued signals and slots (`Qt::QueuedConnection`).44454. **Linux Desktop & Wayland Integration**:46 - Ensure the application runs seamlessly under both Wayland (`-platform wayland`) and X11 (`-platform xcb`).47 - Use native XDG portals for file dialogs (`QFileDialog::DontUseNativeDialog` must NOT be set).48 - Support dark/light system color scheme switching via `QStyleHints::colorSchemeChanged`.49505. **Static Analysis & Automated Verification**:51 - Run `qmllint` on all QML source files to catch unbound properties and type mismatches.52 - Format QML files with `qmlformat`.53 - Write automated unit tests using `QTest` and `Qt Quick Test`.5455## Reference Library5657Consult these authoritative references for deep engineering guidelines:58- [Qt Architecture & Modules](references/qt-architecture.md)59- [QML Language & Modules](references/qml-engineering.md)60- [QML & C++ Integration](references/qml-cpp-integration.md)61- [Qt Quick & Scene Graph](references/qt-quick.md)62- [Qt Widgets Desktop Engineering](references/qt-widgets.md)63- [Qt Threading & Concurrency](references/qt-threading.md)64- [Qt Linux Desktop Integration](references/qt-desktop-integration.md)65- [Qt Testing & Quality](references/qt-testing.md)