Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
5.3.1, 6.7
-
None
-
Windows
Description
Hello,
This is my first bug submit, sorry if something is wrong or incomplete.
Trying to load a component using the setData call for QQmlComponent fails, when the data contains an include to a further directory. (Even if not used)
QtQuick2ApplicationViewer viewer; viewer.setMainQmlFile(QStringLiteral("qml/main.qml")); viewer.showExpanded(); QQmlContext *context = new QQmlContext(viewer.rootContext()); QQmlComponent component(viewer.engine()); component.setData( "import QtQuick 2.0;import \"Boxes\";Rectangle { width: 100; height: 62;}",QUrl("qml/"));
This generates an ASSERT
ASSERT: "!url.isRelative() && (QQmlFile::urlToLocalFileOrQrc(url).isEmpty() || !QDir::isRelativePath(QQmlFile::urlToLocalFileOrQrc(url)))"
in file qml\qqmltypeloader.cpp, line 1665
Url value before the assert in getQmlDir is "://qml/Boxes/qmldir"
Am I doing something wrong? Is it normal that the "qmldir" string gets added to the url from QQmlTypeLoader::Blob::addImport?
I tried various QUrl, without success.
Thanks and regards,
Christophe
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-41037 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
489633,3 | QQmlComponent::setData: Ensure url is suitable for typeloader | dev | qt/qtdeclarative | Status: NEW | -1 | 0 |