Feature Parity 01: Remove bitcoin/src/qt GUI Dependencies from gui-qml #505

Closed
opened 2026-02-28 16:54:02 +00:00 by johnny9 · 1 comment
johnny9 commented 2026-02-28 16:54:02 +00:00 (Migrated from github.com)

Summary

Create a clean boundary where gui-qml does not depend on Qt Widgets-era classes under bitcoin/src/qt.

Complexity

  • XL

Dependencies

  • None

Global Constraints

  • All implementation lives under gui-qml/.
  • No GUI runtime dependency on bitcoin/src/qt components. Reused logic must be moved/ported into gui-qml/.
  • Do not change interfaces::Wallet or interfaces::Node in this version.
  • Issue completion must satisfy DefinitionOfDone.md.

Scope

  • Audit and remove includes in qml/* that point to qt/* headers.
  • Port or re-implement required helpers/models in gui-qml/qml C++ modules (peer table/sort, formatting, URI helpers, network style wrappers as needed).
  • Adjust CMake targets/includes so gui-qml compiles without qt GUI-model reuse.
  • Keep behavior parity for already-working features while moving code.

Acceptance Criteria (DoD-Aligned)

  1. rg -n "#include <qt/|#include <bitcoin/src/qt/" qml returns no results for GUI runtime code paths.
  2. App builds and boots in node-only and wallet-enabled modes.
  3. Existing Peers/Activity/Send/Receive surfaces continue to function after migration.
  4. No new main-thread blocking behavior introduced during migration.

Required Tests

  • C++ unit tests: Unit tests for each newly ported C++ helper/model in qml/.
  • QML QTest: QTests for any QML surface touched by migrated models.

Implementation Notes

  • Start here; this is a hard dependency for the full parity program.
  • Preserve API shapes where possible to minimize QML churn.

Tasks

  • Port qt/bitcoinunits.h usage to a local qml/ formatter and update CoinsListModel + WalletQmlModel formatting call sites.
  • Add unit coverage for the local amount formatter and wire it into test/CMakeLists.txt.
  • Replace qt/networkstyle.h usage in qml/bitcoin.cpp + qml/imageprovider.cpp with local equivalents.
  • Replace qt/guiutil.h usage in qml/bitcoin.cpp (font loading) with a local helper or Qt-native equivalent.
  • Remove qt/initexecutor.h dependency (port/replace InitExecutor as needed).
  • Remove qt/guiutil.h and qt/rpcconsole.h usage from PeerDetailsModel by porting peer stats formatting helpers into qml/.
  • Replace qt/peertablesortproxy.h usage with a local PeerListSortProxy implementation.
  • Replace peer-table and proxy dependencies: qt/peertablemodel.h, qt/peertablesortproxy.h, qt/rpcconsole.h in qml/models/*.
  • Replace qt/optionsmodel.h and qt/guiconstants.h usage in qml/models/options_model.cpp.
  • Remove bitcoin/src/qt include path from app CMake once the QML runtime no longer includes qt headers.
  • Run full regression E2E smoke flow after the last qt dependency is removed (test/functional/qml_test_regression_smoke.py).
## Summary Create a clean boundary where gui-qml does not depend on Qt Widgets-era classes under `bitcoin/src/qt`. ## Complexity - `XL` ## Dependencies - `None` ## Global Constraints - All implementation lives under `gui-qml/`. - No GUI runtime dependency on `bitcoin/src/qt` components. Reused logic must be moved/ported into `gui-qml/`. - Do not change `interfaces::Wallet` or `interfaces::Node` in this version. - Issue completion must satisfy `DefinitionOfDone.md`. ## Scope - Audit and remove includes in `qml/*` that point to `qt/*` headers. - Port or re-implement required helpers/models in `gui-qml/qml` C++ modules (peer table/sort, formatting, URI helpers, network style wrappers as needed). - Adjust CMake targets/includes so gui-qml compiles without qt GUI-model reuse. - Keep behavior parity for already-working features while moving code. ## Acceptance Criteria (DoD-Aligned) 1. `rg -n "#include <qt/|#include <bitcoin/src/qt/" qml` returns no results for GUI runtime code paths. 2. App builds and boots in node-only and wallet-enabled modes. 3. Existing Peers/Activity/Send/Receive surfaces continue to function after migration. 4. No new main-thread blocking behavior introduced during migration. ## Required Tests - C++ unit tests: Unit tests for each newly ported C++ helper/model in `qml/`. - QML QTest: QTests for any QML surface touched by migrated models. ## Implementation Notes - Start here; this is a hard dependency for the full parity program. - Preserve API shapes where possible to minimize QML churn. ## Tasks - [ ] Port `qt/bitcoinunits.h` usage to a local `qml/` formatter and update `CoinsListModel` + `WalletQmlModel` formatting call sites. - [ ] Add unit coverage for the local amount formatter and wire it into `test/CMakeLists.txt`. - [ ] Replace `qt/networkstyle.h` usage in `qml/bitcoin.cpp` + `qml/imageprovider.cpp` with local equivalents. - [ ] Replace `qt/guiutil.h` usage in `qml/bitcoin.cpp` (font loading) with a local helper or Qt-native equivalent. - [ ] Remove `qt/initexecutor.h` dependency (port/replace InitExecutor as needed). - [ ] Remove `qt/guiutil.h` and `qt/rpcconsole.h` usage from `PeerDetailsModel` by porting peer stats formatting helpers into `qml/`. - [ ] Replace `qt/peertablesortproxy.h` usage with a local `PeerListSortProxy` implementation. - [ ] Replace peer-table and proxy dependencies: `qt/peertablemodel.h`, `qt/peertablesortproxy.h`, `qt/rpcconsole.h` in `qml/models/*`. - [ ] Replace `qt/optionsmodel.h` and `qt/guiconstants.h` usage in `qml/models/options_model.cpp`. - [ ] Remove `bitcoin/src/qt` include path from app CMake once the QML runtime no longer includes qt headers. - [ ] Run full regression E2E smoke flow after the last qt dependency is removed (`test/functional/qml_test_regression_smoke.py`).
johnny9 commented 2026-05-11 18:41:39 +00:00 (Migrated from github.com)
Closed with https://github.com/bitcoin-core/gui-qml/pull/535
Sign in to join this conversation.
No description provided.