Task: Sync Qt codegen for currency
This page documents a task in the Commission: currency story. It captures the goal, current status, acceptance, and any notes or results.
Goal
Ensure the Qt codegen profile produces output matching the repository for currency (client model, MDI window, detail dialog, history dialog, controller, UI files). Record every delta with category and decision.
Status
| Field | Value |
|---|---|
| State | DONE |
| Parent story | Commission: currency |
| Now | Nothing. |
| Waiting on | Nothing. |
| Next | Nothing. |
| Last touched | 2026-07-08 |
Acceptance
- Qt profile produces zero diff or every delta is classified and the decision recorded; fix commits present where required; build passes.
Plan
Populated currency's org model "Detail fields" table with all 11
UI-exposed fields (previously only the 3 combo fields, added for the
combo-wiring task) — the key line-edit, 6 more line-edits, 2 spin
boxes, plus the 3 combos already there. image_id isn't a detail
field (handled via has_flag_icon). 5 newer domain columns
(spot_days, deliverable, day_basis, base_precedence,
holiday_calendar) aren't in the UI yet — out of scope for this sync
(the UI hasn't been extended to expose them), unaffected either way.
Regenerated all 12 ores.cpp.qt output files for real via
codegen.sh generate --address ores.cpp.qt, then iterated:
regenerate → build → fix → repeat. Per-file classification:
Fixed as template/model bugs (apply everywhere, not currency-only)
delete_request_id_field: iso_code→iso_codes— currency's org model had the wrong field name;delete_currency_requestcarries a pluraliso_codesvector, not a singulariso_code. Model-data fix, not a template fix.- Added
history_protocol_includeto thehistory_dialogtemplate (new optional property, only emitted when set) — the history dialog needs the entity's split history-protocol header whenhistory_request_class=/=history_response_classlive outsideprotocol_include(currency's is the only current user). - Added
flag_icon_column=/=flag_inline_widget=/=flag_accessorto currency's model — missed when the flag-handling migration task added theentityImageId()=/=keyFlagField()=/=keyFlagIcon()overrides by hand without also settinghas_flag_icon's driving property, which meantneeds_image_cachestayed false and the generatedCurrencyControllerctor silently dropped theImageCache*parameter.
Accepted as generated (regenerated files now the source of truth)
CurrencyController.{hpp,cpp}, CurrencyDetailDialog.{hpp,cpp,ui},
CurrencyMdiWindow.{hpp,cpp} — all previously-landed capabilities
(version-nav, NATS notification-wiring, CSV/XML export,
setting-gated visibility, flag handling, combo wiring) generate
correctly and match. New list-view columns (spot_days etc.,
pre-configured in "Columns (Qt model)" but never regenerated) now
surface — confirmed intentional, not scope creep.
Kept hand-written (documented, permanent exceptions)
ClientCurrencyModel.{hpp,cpp}— the synthetic-currency tracking feature (blue-highlighted generated-but-unsaved rows:add_synthetic_currencies=/=is_synthetic=/=mark_as_saved=/ =clear_synthetic_markers, woven into thedata()override's colour logic) has no template equivalent and is too deeply integrated to safely merge in this pass. Reverted the regeneration; filed as a follow-up task rather than rush a risky merge of ~85 lines of custom logic.CurrencyHistoryDialog.{hpp,cpp,ui}— per the story's existing Decision, currency's history response carries per-version diffs (currency_version_history) rather than the plainstd::vector<currency>the template assumes; theresponse.historyassignment doesn't type-check against the template's generic shape. Reverted the regeneration.
Manually restored after generation (currency-specific, no template equivalent)
Three features the template has no mechanism for; re-added by hand on top of the otherwise-accepted generated files, matching the original implementations exactly (log messages, tooltips, icons):
CurrencyMdiWindow=/=CurrencyController: 3 cross-domain navigation signals (showRoundingTypesRequested=/=showMonetaryNaturesRequested=/ =showMarketTiersRequested) relayed toRefdataPlugin, which opens the corresponding auxiliary entity's list window. Toolbar buttons + signal declarations + relay wiring.CurrencyDetailDialog: thesetupGenerateAction()=/ =onGenerateClicked()synthetic-data-fill feature — the setting-gated visibility mechanism is templated (landed earlier), but per that task's own documented decision the actualQActionand its business logic stay hand-written per entity.CurrencyMdiWindow: thesetupGenerateAction()=/=generateSynthetic()batch-generate-N-currencies feature (prompts for a count, callsmodel_->add_synthetic_currencies) — same reasoning, and the reasonClientCurrencyModelhad to stay hand-written in the first place.
Verified via a real rebuild (ores.qt.refdata.lib then the full
whole-app build), not diff-only, at every iteration.
Notes
Filed a follow-up task: migrate ClientCurrencyModel's
synthetic-tracking feature onto the AbstractClientModel base (or a
documented reason it can't/shouldn't move), so the client-model file
can finally be regenerated too and pick up the new list-view columns.
PRs
| PR | Title |
|---|---|
| #1470 | [codegen,qt] Sync Qt codegen for currency |
Review
| Comment summary | File | Decision | Notes |
|---|---|---|---|
Result
10 of 12 Qt output files now regenerate cleanly and are the current
source of truth (ClientCurrencyModel.{hpp,cpp} and
CurrencyHistoryDialog.{hpp,cpp,ui} stay hand-written, documented
exceptions — follow-up filed for the former). Fixed two model-data
bugs (wrong delete-request field name, missing flag-icon
configuration) and added one new template capability
(history_protocol_include) along the way. Three currency-specific
features with no template equivalent (cross-domain navigation,
detail-dialog generate-fill, MDI batch-generate) were manually
restored on top of the generated files, matching the originals
exactly. Verified via full whole-app rebuild, clean. This closes
"Commission: currency"'s Qt-layer work — only the independent
Wt/HTTP capture-filing task remains on the story.