qml文件在qrc中不起作用?

时间:2013-04-03 00:38:27

标签: qt qml

平台: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>

1 个答案:

答案 0 :(得分:0)

see this passage..  component would not load auto.
  

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