Details
-
Task
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
-
None
Description
It is not possible to change the style on the fly, because QQC2 styling is based on QML type registration time file selection, but it is possible to:
- unload all QML,
- destroy any existing QQmlEngine instance(s),
- call qmlClearTypeRegistrations(),
- call QQuickStyle::setStyle(),
- and then re-load the QML content so that QQC2 types are re-registered with the new style.
This process should be clearly documented in QQuickStyle. Preferably, an example should be provided that uses QML Settings to retain the state of the UI, for example.
It is important to emphasize the warning in the qmlClearTypeRegistrations() docs:
Do not call this function while a QQmlEngine exists or behavior will be undefined. Any existing QQmlEngines must be deleted before calling this function. This function only affects the application global cache. Delete the QQmlEngine to clear all cached data relating to that engine.
Attachments
Issue Links
- relates to
-
QDS-14308 Qt UI Viewer differs on the style with QDS
-
- Closed
-
- resulted from
-
QTBUG-68491 QQuickStyle to support dynamic changing
-
- Closed
-