FrameContentTracker QML Type

Provides duplicate frame detection for a given window. More...

Import Statement: import QtApplicationManager
Since: Qt 6.9

Properties

Methods

Detailed Description

FrameContentTracker is used to detect duplicate frames being rendered for a given window.

The window must be a real toplevel Window (from the QtQuick.Window module) or an ApplicationManagerWindow from a multi-process app. These however do not work: WindowObject (from the QtApplicationManager.SystemUI module) as well as ApplicationManagerWindow in single-process mode.

This is useful for detecting unnecessary redraws, which can become a performance issue: the most likely causes are (a) animations that are not stopped, even though they are not visible anymore and (b) Wayland client windows being updated, although they are hidden or the compositor is not showing the updated area(s).

The implementation first copies each rendered frame from the GPU into a QImage on the CPU side. Then this frame is compared pixel-by-pixel to the previous frame. If they are the same, the duplicateFrames counter is incremented.

Note: Do not use this component in a production environment or even when profiling the application, as it will slow down the rendering significantly.

Please note that when using FrameContentTracker as a MonitorModel data source there's no need to set it to running as MonitorModel will already call update() as needed.

Property Documentation

duplicateFrames : real [read-only]

The number of duplicate frames rendered for the given window, since update() was last called (either manually or automatically in case running is set to true).

See also window, running, and update().


interval : int

The interval, in milliseconds, between update() calls while running is true.

See also update() and running.


roleNames : list<string> [read-only]

Names of the roles provided by FrameContentTracker when used as a MonitorModel data source.

See also MonitorModel.


running : bool

If true, update() will get called automatically every interval milliseconds.

When using FrameContentTracker as a MonitorModel data source, this property should be kept as false.

See also update() and interval.


window : Object

The window to be monitored, from which duplicate frames information will be gathered. It must be a real toplevel Window (from the QtQuick.Window module) or an ApplicationManagerWindow from a multi-process app. These however do not work: WindowObject (from the QtApplicationManager.SystemUI module) as well as ApplicationManagerWindow in single-process mode.

Note: Frames are being tracked as soon as this property is set to a valid window instance, even if running is set to false. Setting this property to null will stop the tracking.


Method Documentation

update()

Updates the property duplicateFrames. Then resets the internal counters for the new time period starting from the moment this method is called.

Note that you normally don't have to call this method directly, as FrameContentTracker does it automatically every interval milliseconds while running is set to true.

See also running.


© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.