Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
QDS 4.6.0
-
None
Description
<Summary>
The used assers such as image, font, sound files should be automatically registered to the Qt resource system by being added to the qt_add_qml_module().
<Environment>
1. Windows 11 host
2. QDS 4.6.0
3. Qt 6.8.0
<Reproduction Steps>
1. Clone the code from here: https://git.qt.io/mikio_hirai/qtmultimediastudy/-/commit/96bab0c9a93e4629f594e437e701f1d0487dc180
2. Run the applicatoin on Qt Creator with Qt 6.8.0 (I used msvc kit)
3. You see the error "QSoundEffect(qaudio): Error decoding source qrc:/qt/qml/QtMMContent/test.wav"
<Explanation>
The project above uses "test.wav" in the line 35 of Screen01.ui.qml, which plays on QDS because QtMM.qmlproject catches it with Files on line 81.
However on Qt Creator, the application shows a runtime error below:
QSoundEffect(qaudio): Error decoding source qrc:/qt/qml/QtMMContent/test.wav
I added a function listResources() in main.cpp which outputs the registered resources, in which test.wav is not included.
With current situation, users must manually edit the CMakeLists.txt to add the resources, which is tideous. Also, it may causes overwrites to the manually edited CMakeLists.txt by QDS, which leads to frustration.
<Suggestion>
QDS should automatically pick up the resources and register them to the qt_add_qml_module() of the corresponding QML module in the CMakeLists.txt while generating CMakeLists.txt