Introduction to Qt/QML (Part 49) - Creating New Elements from C++

Опубликовано: 10 Октябрь 2024
на канале: KDAB
7,398
141

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

About the host:
This video is presented by Jesper Pedersen, who started with Qt back when Qt was widgets only and the version was 1.44, which gives him 21 years of experience with Qt. Since 2000 he has taught almost 100 Qt classes, ranging from Qt Widgets to QML. Heck, Jesper even taught a few classes on QTopia Core — Trolltech's initial attempt at creating a phone stack. Today Jesper holds a fancy business title, but that doesn't prevent him from coding both in his job and in his spare time.

About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing, and innovative software across embedded, mobile, and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D, and more. https://www.kdab.com/software-services

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL and C++.

Contact us to find out more at [email protected] or visit our website: https://www.kdab.com/software-service...

We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK, and the USA. https://www.kdab.com/about/contact/