Hi,

I am new to qml ,,so i am going with qt c++ with qml approach ...
I have two views (UI ) in qml . I load 1st UI using below code:

Code:
QDeclarativeView *view = new QDeclarativeView();
        view->rootContext()->setContextProperty("controller",this);
        view->rootContext()->setContextProperty("customModel",getFilterModel());

        view->setSource(QUrl("qrc:/qml/main.qml"));
        view->move(0,0);
        view->showFullScreen();
where getFilterModel() is my custom model.. Now after clicking on row of this ui I load another Ui(QML).

Now here comes the problem:
when i load another UI using above approach its fine i get all the data.
But when i load it using below approch from main.qml :

Code:
 
    Behavior on x {
        PropertyAnimation {
            duration:  500
            easing.type: Easing.InOutQuad
        }
    }

      var component = Qt.createComponent("Second.qml");
                    if (component.status == Component.Ready) {
                        var dynamicObject = component.createObject(container);
                        if (dynamicObject == null) {
                            console.log(component.errorString());
                            break;
                        }
                        dynamicObject.width = container.width;
                        dynamicObject.height = container.height;
                        dynamicObject.anchors.left = container.right;
                    }
                    container.x = -container.width;

Where container is id of miain Rectangle.
It does not loads all the data which i need (Does not bind data set thru custom model) because i have custom model for this ui also.

Code:
       description = new  Description();
       QDeclarativeView *view = new QDeclarativeView();
        view->rootContext()->setContextProperty("customModel",description->createModel());
        view->setSource(QUrl("qrc:/qml/Second.qml"));
         view->move(0,0);
        view->showFullScreen();
So is there any woraround for this issue ... in qt c++ and qml.