Hi,

I am trying to link the .qml file to .h/.cpp files to access the methods.I found in the example, in main.cpp 1 and 2 is written in two different sample projects. which will be the better for mobile apps.

Can anyone explain the difference between :

1.
QQmlContext *context = appEngine.rootContext();
XmlCtlr *xmlctlr = new XmlCtlr();
context->setContextProperty("xmlctlr", xmlctlr);

and

2.
qmlRegisterType<QTQCPPXMLIntegrationV1>("ABC.QTQCP PXMLIntegrationV1", 1, 0, "QTQCPPXMLIntegrationV1");


Which will be the better to map the .h/.cpp to .qml file?