C++ Extension Points Provided By Qt Quick¶
Description of the C++ extension points provided by the Qt Quick module
All QML applications can be extended from C++ in order to use additional functionality implemented in C++ code or to provide a C++ based QML plugin. This topic of extending QML from C++ is covered in the Integrating QML and C++ documentation.
Additionally, the Qt Quick module provides several extension and integration points for C++ developers, specific to this module. In particular, it allows C++ developers to create and register custom
QQuickItem -derived types which can be rendered by Qt Quick. It also provides several scene graph-related classes which allow developers to define their own rendering primitives.
User-Defined QQuickItem-Derived Types¶
While the Qt Quick module already provides a rich library of visual item types for use in a QML application, some developers may wish to define their own item-derived types in C++ and expose them to the QML type system. The easiest way to do this is to subclass
QQuickItem , which is the base type for all visual types in the Qt Quick module. See the
QQuickItem documentation for more details.
Pixmap and Threaded Image Support¶
While the QML engine allows QML application to load images from filesystem or network resources, some applications may require the additional option of loading images from C++ based processes. This can be implemented through the
QQuickImageProvider class, which provides support for pixmap loading and threaded image requests for QML applications. Any QML application that requests an image through the special “image:” URL scheme will be directed to an appropriate image provider to load the image.
For more information, see the
© 2021 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.