Skip to content

Conversation

HTRamsey
Copy link
Collaborator

This compiles cpp code into QML for singletons

@HTRamsey HTRamsey force-pushed the dev-qml-singletons branch from 8c2eff9 to 4781f3d Compare July 21, 2025 05:39
@HTRamsey HTRamsey requested a review from Copilot July 21, 2025 06:25
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 QML type registration by migrating from manual qmlRegisterSingletonType calls to the declarative QML_ELEMENT and QML_SINGLETON macros for C++ types exposed to QML. The changes improve type safety and follow Qt 6's recommended registration patterns.

  • Replaces manual singleton factory functions with declarative QML macros
  • Updates QML import statements to use newly registered singleton types
  • Modernizes the build system with proper QML module configuration

Reviewed Changes

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

Show a summary per file
File Description
src/Utilities/Shape/ShapeFileHelper.h Adds QML_ELEMENT and QML_SINGLETON macros for QML integration
src/QmlControls/ScreenToolsController.h Uncomments QML_ELEMENT and QML_SINGLETON macros
src/QmlControls/QGroundControlQmlGlobal.h Adds QML_NAMED_ELEMENT and QML_SINGLETON macros
src/MAVLink/QGCMAVLink.h Adds QML_NAMED_ELEMENT and QML_SINGLETON macros
src/AnalyzeView/LogDownloadController.h Uncomments QML_ELEMENT and QML_SINGLETON macros
Multiple QML files Removes now-unnecessary import statements for singleton types
src/QGCApplication.cc & src/QmlControls/QGroundControlQmlGlobal.cc Removes manual singleton factory functions and registration calls
CMakeLists.txt & src/CMakeLists.txt Adds QML module configuration


{
// qCDebug(LogDownloadControllerLog) << Q_FUNC_INFO << this;
qCDebug(MAVLinkMessageLog) << this;
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.

The logging category 'MAVLinkMessageLog' is used but may not be defined. The commented line above suggests this should use 'LogDownloadControllerLog' category instead.

Copilot uses AI. Check for mistakes.

{
_fields->clearAndDeleteContents();

qCDebug(MAVLinkMessageLog) << this;
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.

The logging category 'MAVLinkMessageLog' is used but may not be defined. This appears to be inconsistent with the original logging approach.

Copilot uses AI. Check for mistakes.

@HTRamsey HTRamsey marked this pull request as ready for review July 21, 2025 06:38
@HTRamsey HTRamsey force-pushed the dev-qml-singletons branch from 4781f3d to a7da5b9 Compare July 21, 2025 07:51
@HTRamsey HTRamsey merged commit 5e1828e into mavlink:master Jul 21, 2025
14 of 15 checks passed
@HTRamsey HTRamsey deleted the dev-qml-singletons branch July 21, 2025 08:49
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.

1 participant