PDA

View Full Version : Load a simple Page after the Main Page.



mrhevor
26th September 2011, 16:01
Hi @ all,
a simple question: after I create a new project in Qt Quick QML 4.7.xx (Windows & Symbian)
I create two pages:

MAINPAGE.qml
MENU.qml

how can I load MENU.qml or another Page in the same container of MainPage?

I've find this function:


function loadPage(qmlFileString) {
//console.log("Load Page:"+ qmlFileString)
var loadedComponent = Qt.createComponent(qmlFileString);
if (loadedComponent.status == Component.Ready) {
var loadedPage = loadedComponent.createObject(MainPage);
}

but it cant load..


Timer {
interval: 2000; running: true; repeat: false;
onTriggered: { loadPage("Menu.qml");
}

nothing appear...always the same Main page (and if i view status in console log it can show me component it's not ready)

Any idea how to do it?

Thank in advance,
mrhevor. :)

mrhevor
27th September 2011, 11:32
This morning I've maked a lot of debug and this is the error:


Load Page:Menu.qml
error loading block component
file:///C:/Users/me/Downloads/mySoft-build-simulator-Simulator_Qt_for_MinGW_4_4__Qt_SDK__Debug/qml/mySoft/Menu.qml:3 plugin cannot be loaded for module "QtMobility.systeminfo": Cannot load library C:/QtSDK/Simulator/Qt/mingw/imports/QtMobility/systeminfo/declarative_systeminfod.dll: Impossibile trovare il modulo specificato.
Can anyone help me to solve?

Added after 58 minutes:

Ok seems to be solved adding at file PRO this lines:

CONFIG += mobility
MOBILITY += multimedia

Yes, this post can be closed with SOLVED.