0

In my application i need to implement the "first run flow" , so in this case my QML scene will be diffrent. As last thing of this flow i need to run normal flow , so i have to change root Object content. I don't know how to achieve this.

bunny1985
  • 762
  • 6
  • 21

1 Answers1

0

well i have changed my class and added two function

   Q_INVOKABLE void firstRun();
    Q_INVOKABLE void normalRun();

Implementation: firstrun:

qml->setContextProperty("dateModel" , ModelsFactory::getInstance().weightModel);
qml->setContextProperty("personModel" , ModelsFactory::getInstance().personModel);
qml->setContextProperty("Application", this);

AbstractPane *root = qml->createRootObject<AbstractPane>();

app->setScene(root);

normalRun:

QmlDocument *qml;
        qml = QmlDocument::create("asset:///main.qml").parent(this);
        qml->setContextProperty("Application", this);
        AbstractPane *root = qml->createRootObject<AbstractPane>();
        Application::instance()->setScene(root);

as you can see i exposed this reference to qml and in qml , when the flow is finished , i can call Application.normalRun() i can do this becouse i have used Q_INVOKEBALE MAKRO in function declaration; Hope that it will help

bunny1985
  • 762
  • 6
  • 21