[Interest] QML components in QRC resources

mark diener rpzrpzrpz at gmail.com
Sun May 17 02:56:31 CEST 2015


Hello:

>From the docs:

http://doc.qt.io/qt-4.8/qmlreusablecomponents.html#qml-define-components

"A component defined in a .qml file is directly usable by declaring the
name of the component. For example, a button defined in Button.qml is
created by declaring a Button. "

What happens when we want to locate the Button.qml file inside QRC resource
file?

The documentation is missing on the syntax for this.

If you just declare Button { id: gbutton }, the QML engine will trigger
errors "file not found"

import "qrc:/someprefix/somedir/Button.qml" as MyButton

There are some references, albeit not useful, to qmldir inside the qrc
file, but maybe the QML maintainer would have something to say about this
topic.

(Please forgive my transgression, I offered this topic up to the list
before but received no good answers)

Anybody have a clue about this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150516/f8080019/attachment.html>


More information about the Interest mailing list