[Interest] Change QML Application Style on Runtime

randomslap at tutanota.com randomslap at tutanota.com
Tue May 24 17:45:21 CEST 2022


Hello Qt people!

    I would like to inquire your assistance regarding this:
Is there a way to change the style of a QML(QuickControls2) UI of an application while it runs? Specifically the program should work with QQmlApplicationEngine and an ApplicationWindow QML Item.

    I have tried making a simple program that could reload its quick style upon clicking one of the buttons on it. The program appears at first and seems to close and execute the function that tries to reload the style but seems to fail on engine.load(). I have sent an image of all the code and the code files too.

    I would specifically like to implement something like this on a Desktop Environment and being able to load a new style on runtime would allow for unlimited "theming" options.

Thank you for maintaining the Qt Project.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20220524/ea05369d/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot from 2022-05-24 14-41-05.png
Type: image/png
Size: 160702 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20220524/ea05369d/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stylechange.zip
Type: application/zip
Size: 11270 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20220524/ea05369d/attachment-0001.zip>


More information about the Interest mailing list