Skip to content

feat(Settings): allow custom builds to extend generated settings pages - #15026

Merged
DonLakeFlyer merged 1 commit into
mavlink:masterfrom
DonLakeFlyer:custom-build-settings-pages
Sep 2, 2026
Merged

feat(Settings): allow custom builds to extend generated settings pages#15026
DonLakeFlyer merged 1 commit into
mavlink:masterfrom
DonLakeFlyer:custom-build-settings-pages

Conversation

@DonLakeFlyer

Copy link
Copy Markdown
Contributor

Description

Custom builds (QGC_CUSTOM_DIR) can now add, replace, reposition, or remove generated settings pages without overriding the stock generated QML.

How it works

  • Page list overlay<custom>/src/AppSettings/pages/SettingsPages.json is merged into the stock page list at configure time. Overlay entries support insertAfter/insertBefore, replace-in-place (matching name), and { "remove": "<name>" }. All malformed overlays (unknown keys, unknown anchors, duplicate qml outputs, missing names, missing page definitions) are hard configure errors.
  • Page definitions — custom *.SettingsUI.json files shadow stock definitions of the same name.
  • Custom settings groups — custom *.SettingsGroup.json fact metadata feeds the generator; a custom stem colliding with a stock SettingsManager accessor is rejected.
  • Runtime registrationSettingsManager now derives from QQmlPropertyMap and exposes registerCustomSettingsGroup(accessor, group) (takes ownership; rejected groups are deleted). Called from the new QGCCorePlugin::registerCustomSettings hook so generated pages resolve QGroundControl.settingsManager.<accessor>.<fact>.
  • CMake — when an overlay is active, the generated QML output list is computed via the generator's new --list-outputs mode instead of the hardcoded list.

Example

custom-example includes a complete working example: an overlay inserting a "Custom" page, its page definition, fact metadata, SettingsGroup subclass, and plugin registration.

Testing

  • 19 new pytest cases covering overlay merge semantics, validation errors, custom metadata dirs, and CLI --list-outputs/generation
  • New SettingsManagerTest C++ unit test covering registration, rejection paths, and ownership (rejected groups deleted)
  • Stock and custom-example macOS builds verified

This comment was marked as resolved.

This comment was marked as resolved.

@DonLakeFlyer
DonLakeFlyer force-pushed the custom-build-settings-pages branch from 728793b to 9b4a61d Compare September 2, 2026 18:07
@DonLakeFlyer
DonLakeFlyer requested a balanced review from Copilot and removed request for HTRamsey September 2, 2026 18:08

This comment was marked as resolved.

This comment was marked as resolved.

Custom builds (QGC_CUSTOM_DIR) can now add, replace, reposition, or remove
generated settings pages without overriding the stock generated QML:

- SettingsPages.json overlay merged at configure time (insertAfter/
  insertBefore/replace-by-name/remove) with hard-error validation
- Custom *.SettingsUI.json page definitions shadow stock ones
- Custom *.SettingsGroup.json fact metadata feeds the generator; accessor
  collisions with stock SettingsManager Q_PROPERTYs are rejected
- SettingsManager now derives from QQmlPropertyMap and exposes
  registerCustomSettingsGroup (takes ownership; rejected groups deleted),
  invoked via the new QGCCorePlugin::registerCustomSettings hook
- CMake computes the generated output list via the generator's
  --list-outputs mode when an overlay is active
- custom-example includes a complete working example page

This comment was marked as resolved.

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 34.52%. Comparing base (f29efd3) to head (be37448).
⚠️ Report is 353 commits behind head on master.

Files with missing lines Patch % Lines
src/Settings/SettingsManager.cc 47.61% 0 Missing and 11 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15026      +/-   ##
==========================================
+ Coverage   25.47%   34.52%   +9.05%     
==========================================
  Files         769      945     +176     
  Lines       65912    85626   +19714     
  Branches    30495    39466    +8971     
==========================================
+ Hits        16788    29562   +12774     
+ Misses      37285    36421     -864     
- Partials    11839    19643    +7804     
Flag Coverage Δ
unittests 34.52% <50.00%> (+9.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/API/QGCCorePlugin.h 77.27% <100.00%> (+22.72%) ⬆️
src/Settings/SettingsManager.cc 24.73% <47.61%> (+4.21%) ⬆️

... and 661 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c279a29...be37448. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DonLakeFlyer
DonLakeFlyer merged commit a8150b0 into mavlink:master Sep 2, 2026
55 checks passed
@DonLakeFlyer
DonLakeFlyer deleted the custom-build-settings-pages branch September 2, 2026 20:09
DonLakeFlyer added a commit to DonLakeFlyer/TagTracker that referenced this pull request Sep 3, 2026
…elink

Brings the custom/ overlay and CI up to the upstream qgroundcontrol master merged
in the parent commit.

Custom overlay
- Replace .qrc/exclusion resource machinery with qt_add_resources +
  qt_add_qml_module (QGroundControl.CustomControls) per the new custom-build
  contract (CUSTOM_SOURCES/LIBRARIES/INCLUDE_DIRECTORIES/DEFINITIONS)
- Add CustomOverrideInterceptor so qrc:/qml/<path> resolves to the custom
  override under /Custom/qml when one exists
- Update QML imports for renamed/removed upstream modules and drop version numbers

State machine
- Rebase CustomState/CustomStateMachine on upstream QGCState/QGCStateMachine
- Remove duplicated DelayState/FunctionState/SendMavlinkCommandState in favour
  of the upstream implementations

Settings
- Register CustomSettings through QGCCorePlugin::registerCustomSettings and
  expose it as settingsManager.customSettings
- Add the TagTracker settings page via the SettingsPages.json overlay
- Add required label metadata to Custom.SettingsGroup.json

Behaviour moved out of upstream files into supported hooks
- Default-enable CustomPluginLog in CustomPlugin::init()
- EMERGENCY STOP as a toolbar indicator instead of a FlyViewToolBar patch

Removed
- Herelink core plugin/options and the TAG_TRACKER_HERELINK_BUILD conditionals
- Stale custom/android manifest and build.gradle overlay (upstream now covers it)
- tunnel-protocol git submodule; fetched via CPMAddPackage instead

CI
- Rewrite macOS and Android workflows on the upstream composite actions,
  artifacts via upload-artifact, no S3/attestation/Play Store
- Trigger on sync-upstream-master; cancel-in-progress only for pull requests

Refs mavlink/qgroundcontrol#15026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants