Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Location of qtquickcontrols2.conf in resources #987

Closed
mneilly opened this issue Jul 6, 2024 · 3 comments
Closed

Location of qtquickcontrols2.conf in resources #987

mneilly opened this issue Jul 6, 2024 · 3 comments

Comments

@mneilly
Copy link

mneilly commented Jul 6, 2024

Per Supported Environment Variables in Qt Quick Controls, the expected location of qtquickcontrols2.conf is ":/qtquickcontrols2.conf".

If I add qtquickcontrols2.conf to qrc_files it is placed per uri.

Is there a way to force a file to be placed at the root of the application resources? I would like to avoid being required to set QT_QUICK_CONTROLS_CONF to a file system location. It does not appear to accept qrc paths or I could force the env to be set in main.rs before creating the Qt application.

@ahayzen-kdab
Copy link
Collaborator

Hey, so the QmlModule::qrc_files is for setting up QML modules similar to qt_add_qml_module, so they end up in qrc:/qt/qml/<uri>.

Instead maybe CxxQtBuilder::qrc might be closer ? As this is similar to qt_add_resources or adding a resource to the executable ?
https://docs.rs/cxx-qt-build/latest/cxx_qt_build/struct.CxxQtBuilder.html#method.qrc

Note that this would be similar to this test i was adding here https://github.com/KDAB/cxx-qt/pull/981/files

Otherwise if you are using a CMake build and not a Cargo one you can always add it in the normal way.

Let us know if that works or not !

@ahayzen-kdab
Copy link
Collaborator

Also note that the build system being changed which should improve / fix things like Qt resource initialisation which required things like WHOLE_ARCHIVE before. So if qrc doesn't work it might work soon :-)

@LeonMatthesKDAB
Copy link
Collaborator

As of #986 Adding qrc files should now be fully supported, which should allow you to place the config at the required location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants