Tutorial: Writing QML Extensions with C++

The Qt Declarative 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/declarative/tutorials/extending directory.

Tutorial chapters:

  1. Creating a New Type
  2. Connecting to C++ Methods and Signals
  3. Property Binding
  4. Using Custom Property Types
  5. Using List Property Types
  6. Writing an Extension Plugin
  7. In Summary

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