On this page

QQuickWidget - QQuickView Comparison Example

Demonstrates the benefits of QQuickWidget over a QQuickView embedded as a native window.

Qt logo with red overlay demonstrating widget stacking

The example allows showing the same Qt Quick scene within the same QWidget-based user interface using two different approaches:

Clicking on the Show widget overlay checkbox demonstrates a widget stacking case that is not rendering as expected when embedding a native window, while QQuickWidget makes it render as expected.

Running the Example

To run the example from Qt Creator, open the Welcome mode and select the example from Examples. For more information, see Qt Creator: Tutorial: Build and run.

Platform notes

The Qt Quick scene uses direct OpenGL rendering, even when embedded with QQuickWidget. This confirms that rendering continues to use the accelerated 3D API.

Therefore, the example is tied to OpenGL and won't work with other graphics APIs such as Vulkan, Metal, or Direct3D.

Multisample antialiasing

You can enable multisample antialiasing by selecting the corresponding checkbox. When enabled, QQuickWidget renders content into a multisample renderbuffer. After each render pass, the content is resolved into a standard 2D texture. This enables antialiasing for Qt Quick content without affecting the rest of the QWidget-based UI.

If you're using QQuickView, the native window requests multisampling for its surface. This provides similar results, depending on platform support.

Keyboard input

The Qt Quick scene supports user interaction, including text input, regardless of the embedding technology used. When using QQuickWidget, input events are automatically forwarded to the Qt Quick scene.

Example project @ code.qt.io

See also Qt Quick Widgets.

© 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.