Profile QML applications

With QML Profiler, you can find causes for typical performance problems in your applications, such as slowness and unresponsive, stuttering user interfaces.

Note: In this section, you are using advanced menu items. These are not visible by default. To toggle the visibility of advanced menu items, see Customizing the Menu Bar.

To collect data about a QML application:

  1. Set up QML debugging for the project. For more information, see Setting Up QML Debugging.

    Note: To profile applications on devices, you must install Qt libraries on them.

  2. Go to Analyze > QML Profiler to profile the current application.

    {QML Profiler}

  3. Select (Start) to start the application from QML Profiler.

QML Profiler immediately begins to collect data, as indicated by the time running in the Elapsed field.

Note: If data collection does not start automatically, select (Enable Profiling).

Data is collected until you select again. Data collection takes time, so expect a delay before seeing data.

Do not use application commands to exit the application because data is sent to QML Profiler when you select . The application stops in seconds. If you exit the application, the data is not sent.

Select Disable Profiling to disable the automatic start of the data collection when an application is launched. Data collection starts when you select the button again.

To save all the collected data, select Analyze > QML Profiler Options > Save QML Trace. To view the saved data, select Load QML Trace. You can also deliver the saved data to others for examination or load data saved by them.

Flush data while profiling

Set data flushing preferences either globally for all projects or separately for each project.

To set global preferences, go to Preferences > Analyzer > QML Profiler.

To specify custom QML Profiler settings for a particular project:

  1. Go to Projects > Run.
  2. In QML Profiler Settings, select Custom.

    {QML Profiler Settings}

You can set the following preferences:

SettingValue
Flush data while profilingFlush the data periodically instead of flushing all data when profiling stops. This saves memory on the target device and shortens the wait between the profiling being stopped and the data being displayed.
Flush intervalSet the flush interval in milliseconds. The shorter the interval, the more often the data is flushed. The longer the interval, the more data has to be buffered in the target application, potentially wasting memory. However, the flushing itself takes time, which can distort the profiling results.
Process data only when process endsAggregate data from many QML engines into one trace. Otherwise, the profiling stops when one of the engines stops.

To restore the global settings for the project, select Restore Global.

Attach to a running Qt Quick application

You can profile a Qt Quick application that you do not run from Qt Design Studio. However, you must enable QML debugging and profiling for the application in the project build settings. For more information, see Setting Up QML Debugging.

To attach to a waiting application:

  1. Go to Analyze > QML Profiler (Attach to Waiting Application).

    {Start QML Profiler dialog}

  2. In Kit, select the kit used to build the application.
  3. In Port, specify the port to listen to.
  4. Select OK.

See also Profiling QML applications.

Available under certain Qt licenses.
Find out more.