Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
5.6.0 Beta
-
None
-
Android
-
-
5ef14c52d0275e721153b15acfb0410b9889014a
Description
We try to use another QML file on Android. But it looks like that the QFileSelector/QQmlFileSelector won't detect the correct +subdir.
We tried QQmlApplicationEngine with default QFileSelector and a replaced selector and added extraSelectors like "+test". Both won't work as expected.
The following example works from C++ code.
But QML will display "assets://qml/provider/ProviderDetailView.qml" instead of the "+test" file.
Same problem with default "+android" on Android!!
QFileSelector* sel = new QFileSelector(); sel->setExtraSelectors(QStringList() << "test"); qDebug() << sel->allSelectors(); mEngine.reset(new QQmlApplicationEngine()); auto selector = QQmlFileSelector::get(mEngine.data()); selector->setSelector(sel); qDebug() << sel->select("assets://qml/provider/ProviderDetailView.qml"); .... mEngine->load(QUrl("assets://qml/main.qml"));
assets:/qml/provider/+test/ProviderDetailView.qml
Looks like this bug exists since at least two years:
https://forum.qt.io/topic/39642/qqmlfileselector-not-working-on-android-from-assets-folder
It works if we put every qml file into a qrc, compiles it to an rcc file and use "mEngine->load(QUrl("qrc:/qml/main.qml"));"