0

平台:win8、qt5.0

this->engine = new QQmlEngine;
this->component = new QQmlComponent(this->engine, ":/Foodie.qml");
this->mainWindow = new QQuickWindow;


while(this->component->isReady()) {
    this->mainItem = qobject_cast<QQuickItem*>(component->create());
    this->mainItem->setParentItem(this->mainWindow->contentItem());
    break;
}



<RCC>
    <qresource prefix="/">
        <file>Foodie.qml</file>
    </qresource>
</RCC>
4

1 回答 1

0
see this passage..  component would not load auto.

https://bugreports.qt.io/browse/QTBUG-12916

于 2013-04-03T01:03:43.410 回答