Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Style Settings in Qt Quick (+ Designer)
alexander.merkel last edited by
I am planning to write a set of custom components in a way that other people can use the QtCreator Design mode to create a Gui. I intend to create these components in different styles that can be switched from within the Design mode by inserting the name of a Style in some property field.(This is the most usable way I could come up with.)
I cannot find a proper solution for this problem, all my approaches have some sort of flaw.
- Putting all the styles in contextProperties:
-prohibits a style change in Design mode since contextProperty values cannot be accessed. All you get in Design mode is #contextPropertyName# if i am not mistaken.
IS THERE A REPAINT ALL that could do that???
i also had trouble getting the function to change the variable values in Design mode
- I have a (kind of) working solution involving QtObjects holding style properties and a loader dynamically changing its source. But that would involve loading the Style Objects into every Component which might be bad for performance.