Codegen Add QT Entity

Table of Contents

When to use this skill

When you need to add Qt desktop UI for a new entity in ores.qt. Prerequisites: the domain type must exist (domain-type-creator) and the server-side handlers must be implemented. See Entity lifecycle for the full layer ordering. If real-time updates are needed, the eventing infrastructure must also be in place.

Codegen (--profile qt) is the primary path — always try it first.

How to use this skill

  1. Generate with codegen (preferred): cd projects/ores.codegen && ./run_generator.sh models/{component}/{entity}_domain_entity.json --profile qt Then go directly to Phase 4 (controller wiring).
  2. If manual creation is needed, work through four phases:
    • Phase 1 — ClientModel + list window (PR: [qt] Add {Entity} model and list window): async model with pagination + QAbstractTableModel; list window with toolbar, sort/filter proxy, table view.
    • Phase 2 — detail dialog (PR: [qt] Add {Entity} detail dialog): form editors, async save, accepted=/=rejected signals.
    • Phase 3 — history dialog (PR: [qt] Add {Entity} history dialog): read-only versioned view via a separate history model.
    • Phase 4 — controller + integration (PR: [qt] Integrate {Entity} controller and update diagrams): register in MainWindow.cpp; update class diagrams; add recipe docs.
  3. Select an icon for toolbar actions using icon-guidelines.

Use feature-branch-manager between phases and pr-manager to open each PR. Build after every step: cmake --build --preset linux-clang-debug-ninja --target ores.qt.lib.

Recipes

Reference

Templates

Runs via --profile qt (12 templates). Full output paths are in Qt entity patterns§"Templates". Read the template directly for the authoritative implementation — do not reproduce it here.

Template Generates
cpp_qt_client_model.hpp.mustache Client{Entity}Model.hpp
cpp_qt_client_model.cpp.mustache Client{Entity}Model.cpp
cpp_qt_mdi_window.hpp.mustache {Entity}MdiWindow.hpp
cpp_qt_mdi_window.cpp.mustache {Entity}MdiWindow.cpp
cpp_qt_detail_dialog.hpp.mustache {Entity}DetailDialog.hpp
cpp_qt_detail_dialog.cpp.mustache {Entity}DetailDialog.cpp
cpp_qt_history_dialog.hpp.mustache {Entity}HistoryDialog.hpp
cpp_qt_history_dialog.cpp.mustache {Entity}HistoryDialog.cpp
cpp_qt_controller.hpp.mustache {Entity}Controller.hpp
cpp_qt_controller.cpp.mustache {Entity}Controller.cpp
qt_detail_dialog_ui.mustache {Entity}DetailDialog.ui
qt_history_dialog_ui.mustache {Entity}HistoryDialog.ui

Emacs 29.1 (Org mode 9.6.6)