Skip to content

Conversation

HTRamsey
Copy link
Collaborator

@HTRamsey HTRamsey commented Jul 21, 2025

Removes most of the manual qml registrations in favor of QML_ELEMENT.
This greatly improves linting and compiling cpp objects to qml.

@HTRamsey HTRamsey force-pushed the dev-qmlelement branch 2 times, most recently from 7e0db60 to 4e76cdb Compare July 21, 2025 12:25
@HTRamsey HTRamsey requested review from DonLakeFlyer and Copilot July 21, 2025 12:32
Copilot

This comment was marked as outdated.

@HTRamsey HTRamsey marked this pull request as ready for review July 21, 2025 12:47
@HTRamsey HTRamsey requested a review from Copilot July 21, 2025 13:37
Copilot

This comment was marked as outdated.

@HTRamsey HTRamsey requested a review from Copilot July 21, 2025 15:24
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modernizes the QML registration system by replacing manual qmlRegisterType() calls with the newer QML_ELEMENT and QML_UNCREATABLE() macros. The changes improve compile-time type checking and linting for QML objects, providing better development tooling support.

Key changes include:

  • Removal of manual QML type registrations from C++ initialization code
  • Addition of QML_ELEMENT macros to C++ class headers
  • Update of QML import statements to use consolidated imports
  • Cleanup of obsolete registration functions and their calls

Reviewed Changes

Copilot reviewed 300 out of 522 changed files in this pull request and generated 2 comments.

File Description
Multiple .h files Added QML_ELEMENT/QML_UNCREATABLE macros to class definitions
Multiple .cc files Removed manual qmlRegisterType calls and registration functions
Multiple .qml files Updated import statements to use QGroundControl instead of specific modules
src/QGCApplication.cc Removed bulk of manual QML type registrations from initialization
Comments suppressed due to low confidence (1)

src/QmlControls/HorizontalFactValueGrid.qml:22

  • [nitpick] The template name 'HorizontalFactValueGridTemplate' is inconsistent with the QML_NAMED_ELEMENT declaration which suggests a more descriptive naming pattern. Consider using a more conventional naming approach.
HorizontalFactValueGridTemplate {


public:
HorizontalFactValueGrid(QQuickItem *parent = nullptr);
explicit HorizontalFactValueGrid(QQuickItem *parent = nullptr);
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding 'explicit' to the constructor is good practice, but ensure this change is consistent with the base class constructor pattern and doesn't break existing code that relies on implicit conversion.

Copilot uses AI. Check for mistakes.


public:
QGCPositionManager(QObject *parent = nullptr);
explicit QGCPositionManager(QObject *parent = nullptr);
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding 'explicit' to single-parameter constructors is good practice for preventing implicit conversions. Ensure this change is consistently applied across similar constructors in the codebase.

Copilot uses AI. Check for mistakes.

@HTRamsey HTRamsey force-pushed the dev-qmlelement branch 2 times, most recently from 65c1401 to 906daee Compare July 21, 2025 19:12
@HTRamsey HTRamsey merged commit 69dc76e into mavlink:master Jul 22, 2025
16 checks passed
@HTRamsey HTRamsey deleted the dev-qmlelement branch July 22, 2025 05:30
@DonLakeFlyer
Copy link
Contributor

Great stuff, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants