Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for QML debugging/profiling #2623

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

yann-lty
Copy link
Member

@yann-lty yann-lty commented Dec 20, 2024

Description

This PR adds the required setup to be able to attach the QML debugger/profiler to Meshroom.

QML debugging can be activated using the environment variable

MESHROOM_QML_DEBUG=1

And optionally configured using (with params as expected by -qmljsdebugger):

MESHROOM_QML_DEBUG_PARAMS=port:5555

The help of those environment variables can be accessed via CLI using:

> meshroom --env-help
Meshroom environment variables:
MESHROOM_QML_DEBUG: Enable QML debugging (bool, default: 'False')
MESHROOM_QML_DEBUG_PARAMS: QML debugging params as expected by -qmljsdebugger (str, default: 'port:3768')

Usage

Debugger

This can be used to attach the QML debugger from Qt Creator, using:

Debug > Start Debugging > Attach to QML port...

Profiler

This setup can also be used to attach the QML profiler, either interactively from Qt Creator

Analyze > QML Profiler

or from command line:

qmlprofiler --attach localhost -p <port> --interactive

Features list

  • Add support for enabling QML debugging
  • Add --env-help CLI option to Meshroom app to display env var help/documentation

Implementation remarks

This PR also introduces an new class EnvVar (meshroom.env.EnvVar) that is designed to centralize the management of environment variables in Meshroom.

from meshroom.env import EnvVar

EnvVar.get(EnvVar.MESHROOM_QML_DEBUG)

@yann-lty yann-lty force-pushed the dev/qmlDebuggerSetup branch from 9ef0003 to 58e41e1 Compare December 20, 2024 16:37
@yann-lty yann-lty marked this pull request as ready for review December 20, 2024 16:52
Instead of passing the style via QApplication arguments,
use the QQuickStyle API.
Introduce new environment variable to enable and configure
QML debugging when starting Meshroom GUI app.

Introduce a new EnvVar class to centralize the management of
environment variables across Meshroom.
Add a new CLI option to print the available Meshroom environment
variables and their descriptions.
@yann-lty yann-lty force-pushed the dev/qmlDebuggerSetup branch from 58e41e1 to c20ecaa Compare December 20, 2024 17:28
Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.90%. Comparing base (aeb77d8) to head (c20ecaa).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2623   +/-   ##
========================================
  Coverage    69.90%   69.90%           
========================================
  Files          121      121           
  Lines         7078     7078           
========================================
  Hits          4948     4948           
  Misses        2130     2130           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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