Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.9.0
-
None
-
Windows 10 Enterprise 64 bit (x64)
QT Creator 5.9
minw_32
Description
When using createTemporaryQmlObject(), imports in the qml string (first argument) appear not support relative paths, or at least the path it is relative to is not the desired path.
Given a tst_Bubba.qml like this:
function test_bubba() { var item = createTemporaryQmlObject("import QtQuick 2.0; import \"../App\"; Bubba {}", testCase); compare(item.color, "#ff0000") mouseClick(item, 0, 0, Qt.LeftButton); compare(item.color, "#00ff00") }
Where ../App/Bubba.qml exists relative to tst_Bubba.qml, the following error is given:
Uncaught exception: Qt.createQmlObject(): failed to create object: file:///C:/Qt/Qt5.9.0/5.9/mingw53_32/qml/QtTest/undefined:1:21: "../App": no such directory
If I don't use createTemporaryQmlObject but rather have:
import QtQuick 2.0 import "../App" Bubba { }
"Bubba" resolves just fine.