Difference between setContextProperty and Qml registertype.
I created an UserAccessCtlr .cpp/UserAccessCtlr .h, which has methods. This method has to call from main.qml.
I had used to QQmlContext in the main.cpp to link the .cpp/.h files. Is it the right way, since I saw in sample, qmlRegistType.
qmlRegisterType<MapQuickView>("Esri.QTQCPPXMLIntegrationV1", 1, 0, "MapView");
QQmlContext *context = appEngine.rootContext();
UserAccessCtlr *useraccessctlr = new UserAccessCtlr();
What is the difference and which one i have to use it?
Option 1 makes your type known to the QML engine and then you can instantiate new objects from that type directly in your QML code.
Option 2 "adds" an object to the context that you can use from your QML code.
Which one to use depends on what you want to do with that object.
Hope it helps.