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].
↧