In Chapter 12, Customization in Qt Quick, we learned to create new QML element types that can be used to provide dynamic data engines or some other type of non-visual objects. Now we will see how to provide new types of visual items to Qt Quick.
The first question you should ask yourself is whether you really need a new type of item. Maybe you can achieve the same goal with the already existing elements? Very often, you can use vector or bitmap images to add custom shapes to your applications, or you can use Canvas to quickly draw the graphics you need directly in QML.
If you decide that you do require custom items, you will be doing that by implementing subclasses of the QQuickItem C++ class, which is the base class for all items in Qt Quick. After creating the new type, you will always have to register it with QML using qmlRegisterType.
...