feat(QmlControls): add QGCStyle module#14604
Conversation
There was a problem hiding this comment.
Pull request overview
Introduces a new QGCStyle Qt Quick Controls style module (built on Basic + Qt Labs StyleKit) and makes it the default UI style, while keeping ScreenTools sizing APIs as compatibility aliases and wiring new accessibility/interface-density preferences through Settings.
Changes:
- Add the
QGCStyleQML module (metrics, typography, preferences, layout profile) plus StyleKit-based templates/gallery. - Make
QGCStylethe default Qt Quick Controls style and align Qt’s applicationQPalettewithQGCPalette. - Add unit tests covering palette contrast/sync, style loading/rendering, live scaling, and Basic-style compatibility for
QGCLabel.
Reviewed changes
Copilot reviewed 49 out of 49 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/QmlUITests/QmlUITestBase.cc | Switch UI tests to run under QGCStyle. |
| test/QmlControls/QGCStyleTest.h | Declare new unit test coverage for QGCStyle. |
| test/QmlControls/QGCStyleTest.cc | Add QML-driven tests for style loading, metrics, scaling, and compatibility. |
| test/QmlControls/QGCPaletteTest.h | Declare new unit test coverage for QGCPalette/application palette sync. |
| test/QmlControls/QGCPaletteTest.cc | Add tests validating palette initialization, sync, and contrast thresholds. |
| test/QmlControls/QGCLabelBasicStyleTestMain.cc | Add a small runner to validate QGCLabel under Basic style. |
| test/QmlControls/CMakeLists.txt | Register new tests and the Basic-style runner test in CTest. |
| src/Settings/AppSettings.h | Add new settings facts for contrast/motion/density preferences. |
| src/Settings/AppSettings.cc | Register new settings facts for contrast/motion/density preferences. |
| src/Settings/App.SettingsGroup.json | Define new settings UI metadata for accessibility + density options. |
| src/QmlControls/ToolStripHoverButton.qml | Drive hover enabling via QGCStyle preferences. |
| src/QmlControls/SubMenuButton.qml | Drive hover enabling via QGCStyle preferences. |
| src/QmlControls/SettingsButton.qml | Drive hover enabling via QGCStyle preferences. |
| src/QmlControls/ScreenToolsController.h | Refactor controller to expose screen metrics + touch capability with notifies. |
| src/QmlControls/ScreenToolsController.cc | Implement live screen/touch tracking and screen-metric updates. |
| src/QmlControls/ScreenTools.qml | Convert legacy metrics to QGCStyle-backed compatibility aliases. |
| src/QmlControls/QGCTextField.qml | Apply tabular-number font features for numeric-only fields. |
| src/QmlControls/QGCStyleEnvironment.qml | Bind app settings + runtime environment into QGCStyle singletons. |
| src/QmlControls/QGCStyle/Templates/Label.qml | Provide Label template defaults aligned with the palette. |
| src/QmlControls/QGCStyle/Templates/ApplicationWindow.qml | Provide ApplicationWindow template integrating StyleKit + transitions. |
| src/QmlControls/QGCStyle/StyleTypography.qml | Centralize font families, sizes, and derived typography metrics. |
| src/QmlControls/QGCStyle/StylePreferences.qml | Centralize reduced motion, high contrast, hover, and touch-density preferences. |
| src/QmlControls/QGCStyle/StyleMetrics.qml | Centralize control sizing, spacing, radii, animation durations, etc. |
| src/QmlControls/QGCStyle/StyleKit/QGCStyleKitPreview.qml | Add a small StyleKit preview surface for manual validation. |
| src/QmlControls/QGCStyle/StyleKit/QGCStyleKit.qml | Define StyleKit styling rules/variations (primary/compact) for controls. |
| src/QmlControls/QGCStyle/StyleKit/QGCStyleGallery.qml | Add a state gallery to exercise control visuals across settings. |
| src/QmlControls/QGCStyle/qtquickcontrols2.conf | Set QGCStyle as the default QQuickControls2 style with Basic fallback. |
| src/QmlControls/QGCStyle/LayoutProfile.qml | Provide layout profile logic (tiny/short, touch target fallback). |
| src/QmlControls/QGCStyle/CMakeLists.txt | Build and package the QGCStyle QML module + style config resource. |
| src/QmlControls/QGCRadioButton.qml | Drive hover enabling via QGCStyle preferences. |
| src/QmlControls/QGCPalette.h | Add application palette initialization/sync hooks and sync on setters. |
| src/QmlControls/QGCPalette.cc | Implement application QPalette synchronization and initialization flow. |
| src/QmlControls/QGCLabel.qml | Rebase QGCLabel on Controls Label and rely on style/template defaults. |
| src/QmlControls/QGCDelayButton.qml | Drive hover enabling via QGCStyle preferences. |
| src/QmlControls/QGCComboBox.qml | Use QGCStyle icon sizing for dropdown indicator. |
| src/QmlControls/QGCCheckBox.qml | Drive hover enabling via QGCStyle preferences. |
| src/QmlControls/QGCButton.qml | Drive hover enabling via QGCStyle preferences. |
| src/QmlControls/InstrumentValueValue.qml | Apply tabular-number font features for numeric value display. |
| src/QmlControls/CMakeLists.txt | Add QGCStyle subdir and make Controls module depend on QGCStyle. |
| src/QmlControls/AppSettings.qml | Drive hover enabling via QGCStyle preferences in settings UI. |
| src/QGCApplication.h | Add helpers/state to load and apply application fonts. |
| src/QGCApplication.cc | Make QGCStyle default, centralize font loading, and init application palette. |
| src/MainWindow/MainWindow.qml | Install QGCStyleEnvironment to connect runtime/settings into style singletons. |
| src/CMakeLists.txt | Link Qt6::LabsStyleKit and the QGCStyle target into the app. |
| src/AppSettings/QmlTest.qml | Expose QGCStyle gallery/preview in the AppSettings QML test surface. |
| src/AppSettings/pages/General.SettingsUI.json | Add the new accessibility/density settings to General settings UI. |
| src/AppSettings/CMakeLists.txt | Add QGCStyle as a dependency for the AppSettings QML module. |
| resources/qtquickcontrols2.conf | Remove legacy global quick controls style config (moved into QGCStyle). |
| CMakeLists.txt | Add Qt6::LabsStyleKit dependency and remove legacy quick controls conf resource setup. |
| #include <QtGui/private/qguiapplication_p.h> | ||
| #include <QtGui/private/qinputdevicemanager_p.h> |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #14604 +/- ##
==========================================
+ Coverage 25.47% 30.78% +5.31%
==========================================
Files 769 783 +14
Lines 65912 66911 +999
Branches 30495 31027 +532
==========================================
+ Hits 16788 20598 +3810
+ Misses 37285 32262 -5023
- Partials 11839 14051 +2212
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 434 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Build ResultsPlatform Status
All builds passed. Pre-commit
Pre-commit hooks: 0 passed, 0 failed, 0 skipped. Test Resultslinux-coverage-integration: 27 passed, 0 skipped Code Coverage
Artifact Sizes
Updated: 2026-07-15 18:10:50 UTC • Commit: 641891b • Triggered by: Android |
b2b71a4 to
cc7a901
Compare
| readonly property real _screenPixelDensity: { | ||
| const density = root._screen ? root._screen.pixelDensity : 0 | ||
| return Number.isFinite(density) && density > 0 ? density : 1 | ||
| } |
| readonly property real screenWidth: root.isFakeMobile ? 731 : (root._screen ? root._screen.width : 0) | ||
| readonly property real screenHeight: root.isFakeMobile ? 411 : (root._screen ? root._screen.height : 0) |
| property var _corePlugin: QGroundControl.corePlugin | ||
| property var _corePluginOptions: QGroundControl.corePlugin.options | ||
| property bool _guidedActionsEnabled: (!ScreenTools.isDebug && _corePluginOptions.guidedActionsRequireRCRSSI && _activeVehicle) ? _rcRSSIAvailable : _activeVehicle | ||
| property bool _guidedActionsEnabled: _activeVehicle && (!_corePluginOptions.guidedActionsRequireRCRSSI || _rcRSSIAvailable) |
| onClicked: { | ||
| var editingConfig = _linkManager.createConfiguration(ScreenTools.isSerialAvailable ? LinkConfiguration.TypeSerial : LinkConfiguration.TypeUdp, "") | ||
| var editingConfig = _linkManager.createConfiguration(0, "") | ||
| linkDialogFactory.open({ editingConfig: editingConfig, originalConfig: null }) | ||
| } |
cc7a901 to
a6286de
Compare
a6286de to
e7a6cfc
Compare
e7a6cfc to
d6fa032
Compare
d6fa032 to
5c82dde
Compare
5c82dde to
641891b
Compare
Description
Introduce a dedicated
QGCStyleQt Quick Controls style and make it the application's default style.This change:
ApplicationWindowandLabelqtquickcontrols2.confinto the style moduleScreenToolssizing APIs as compatibility aliases while moving visual metrics into QGCStyleQt.platform.osand trims obsolete ScreenToolsController stateThe goal is to establish one declarative styling boundary while allowing existing QGC controls to migrate incrementally.
Type of Change
Testing
Commands run:
cmake --build build --target QGroundControlcmake --build build --target QGCStyle_qmllintcmake --build build --target AppSettingsModule_qmllintctest --test-dir build --output-on-failure -R '^QGCStyleTest$'Platforms Tested
Flight Stacks Tested
Not applicable to this UI infrastructure change.
Screenshots
Not included yet; this is intentionally opened as a draft.
Checklist
Related Issues
None.
By submitting this pull request, I confirm that my contribution is made under the terms of the project's dual license (Apache 2.0 and GPL v3).