开发者

Problem with embedding QML into resource Qt application

I have some problem with embedding my QML component into resource of my application.

I have some gui.qml

import QtQuick 1.0

Rectangle {
 开发者_如何学编程   width: 480
    height: 525
    color: "#ffff00"
}

My dirs

\main.cpp
\gui.qml

I tried run it:

view = new QDeclarativeView(m_GUI);
view->setSource(QUrl("qrc:/gui.qml"));

But i catch:

qrc:/gui.qml: File not found 

What's wrong?


Thank all ) I solved it.

In resource i have "Prefix" for the root path.

view->setSource(QUrl("qrc:/MyPrefix/gui.qml"));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜