Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Qt qml文件在qrc中不工作?_Qt_Qml - Fatal编程技术网

Qt qml文件在qrc中不工作?

Qt 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

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