Qt qml文件在qrc中不工作?
平台:win8,qt5.0Qt qml文件在qrc中不工作?,qt,qml,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<QQuic
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>
this->engine=newqqmlengine;
this->component=newqqmlcomponent(this->engine,:/Foodie.qml”);
此->主窗口=新的QQuickWindow;
而(此->组件->isReady()){
此->mainItem=qobject_cast(组件->创建());
this->mainItem->setParentItem(this->mainWindow->contentItem());
打破
}
Foodie.qml
see this passage.. component would not load auto.