Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

How to use classes in Qt / QML

$
0
0
Hi, You need add to your kakkanna.h line with this code: QML_DECLARE_TYPE(Kakkanna) Than add the line to you main.cpp file before load the main QML file next code: mlRegisterType<Kakkanna>("com.kakkanna", 1, 0, "Kakkanna"); In main QML file you need add line on the top of file: import com.kakkanna 1.0 And now you can create and use your class in QML file:     Kakkanna {         id: someIdHere     } Also you can read about QML plugins here [qt-project.org].

Viewing all articles
Browse latest Browse all 4972

Trending Articles