Writing QML Extensions with C++
The Qt QML module provides a set of APIs for extending QML through C++ extensions. You can write extensions to add your own QML types, extend existing Qt types, or call C/C++ functions that are not accessible from ordinary QML code.
This tutorial shows how to write a QML extension using C++ that includes core QML features, including properties, signals and bindings. It also shows how extensions can be deployed through plugins.
You can find the source code for this tutorial in Qt's examples/qml/tutorials/extending directory.
Tutorial chapters:
- Creating a New Type
- Connecting to C++ Methods and Signals
- Property Binding
- Using Custom Property Types
- Using List Property Types
- Writing an Extension Plugin
- In Summary
Many of the topics covered in this tutorial are documented in further detail in Integrating QML and C++ and its documentation sub-topics. In particular, you may be interested in the sub-topics Exposing Attributes of C++ Classes to QML and Defining QML Types from C++.