Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0 RC 1
-
None
-
Linux Ubuntu 12.10 x86_64 using latest build from ppa:canonical-qt5-edgers/qt5-daily
Description
Path resolving in JavaScript is incompatible with Qt 4.x (4.8.3):
I have a project that is working on Qt 4.8.3, folder structure as follows:
Generic/ DynCreator.js App1/ Main.qml Comp.qml
In 4.8 I included the DynCreator.js in Main.qml as:
import "../Generic/DynCreator.js" as DynCreator
DynCreator.js creates components dynamically with dynObject = Qt.createComponent("Comp.qml"); dynObject.createObject(parent);
Qt 4.8 finds Comp.qml as it is same folder as the script that imported the JavaScript (Main.qml) but Qt 5.0 don't find the file as it resolves path relative to imported script location.
So call was modified to: Qt.createComponent("../App1/Comp.qml") in 5.0 and it started working.
If this not intentional behavior-change, this should be WELL documented in 5.0.
Attachments
For Gerrit Dashboard: QTBUG-28411 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
42183,3 | Update porting docs | stable | qt/qtdeclarative | Status: MERGED | +2 | 0 |
42499,1 | Resolve "Porting QML Applications to Qt 5" name conflict | stable | qt/qtdoc | Status: MERGED | -1 | 0 |