Sign up for the KDAB Newsletter
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Find what you need - explore our website and developer resources
27 January 2021
In the previous videos, we've seen how to export individual existing objects from C++ to QML. In this video, we'll show something related, but conceptually quite different. How do we expose C++ classes to QML and let QML create their instances? To keep our lives simple, we'll start by exposing a non-GUI class; the next video will deal with those.
The example code showcased in this video is available here: https://github.com/KDAB/kdabtv
00:00 Introduction
00:33 Creating new elements
02:38 Implementing the element
03:43 Registering the element
05:48 Importing/Using the element
06:02 Code Example
09:04 Subclassing
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Upgrade your applications from Qt 5 to Qt 6 with KDAB’s migration services. Get a free migration assessment and join a hands-on workshop to prepare your team for a successful transition!
Learn more
Learn Modern C++
Our hands-on Modern C++ training courses are designed to quickly familiarize newcomers with the language. They also update professional C++ developers on the latest changes in the language and standard library introduced in recent C++ editions.
Learn more