Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.8.0
-
Symbian R&D SDK week 36 & week 41.
-
001c01e91d9c6cc724a374fcb8371a0551b21958
Description
Main qml is usually set somewhat like this:
int main(int argc, char *argv[]) { QApplication app(argc, argv); QDeclarativeView view; view.setSource(QUrl::fromLocalFile("main.qml")); view.show(); return app.exec(); }
QDeclarativeView::setSource() will end up calling
QUrl::fromLocalFile(QDir::currentPath() + QDir::separator()).resolved(QUrl::fromLocalFile("main.qml"))
Debug prints for Qt Quick application that is in ROM:
Qt 4.7.4
[Qt Message] QDir::currentPath(): "Z:/Private/200346e0"
[Qt Message] QDir::homePath(): "C:/Data"
[Qt Message] QDir::rootPath(): "C:/Data"
[Qt Message] QCoreApplication::applicationDirPath(): "C:/Private/200346e0"
[Qt Message] QCoreApplication::applicationFilePath(): "Z:\sys\bin\componenttest.exe"
Qt 4.8
[Qt Message] QDir::currentPath(): "C:/Private/200346e0"
[Qt Message] QDir::homePath(): "C:/Data"
[Qt Message] QDir::rootPath(): "C:/"
[Qt Message] QCoreApplication::applicationDirPath(): "C:/Private/200346e0"
[Qt Message] QCoreApplication::applicationFilePath(): "Z:\sys\bin\componenttest.exe"
On 4.8 QDir::currentPath() returns C: drive instead of Z:. Main.qml is in z:/Private/200346e0 and end up getting error "file:///C:/Private/200346e0/main.qml: File not found".
Just wondering can that is it ok to change QDir::currentPath() behavior like this between minor versions?
This can be resolved on application level by giving absolute path to QDeclarativeView::setSource() instead.