Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
4.7.0
-
None
-
OS X Sow Leopard, Qt 4.7 2010-08-14.
Description
Assume a QML component in a file qml/Bar.qml:
Item {
// the contents don't matter in this case
....
}
Assume a QML component in a file qml/Foo.qml that uses Bar:
Item { ... Bar { ... } }
This is normal component usage and works fine without any special import paths or import statements as long as the two files are in the same directory.
However, as soon as the two files are added as resources to the application the Bar component can no longer be found, even if the paths are still relative to each other. What I see is more or less (can't copy the exact message here):
qrc:/qml/Foo.qml: Type Bar unavailable
or
qrc:/qml/Foo.qml: Bar is not a type
If QML files are to be usable as resources this normal "component inclusion" mechanism should be supported. To make the files findable I also tried to do:
QDeclarativeEngine::addImportPath() with "qrc:/qml" or ":/qml", but this had no effect.