Qt for HarmonyOS/qtohosextras doc/Color Theme Example
< Qt for HarmonyOS / qtohosextras doc
Color Theme Example
Demonstrates selecting the application color theme and reacting to dark and light theme changes.
The window offers three radio buttons that map to QOhosAppContext::ColorThemeMode::LightTheme, ColorThemeMode::DarkTheme and ColorThemeMode::FollowSystemSetting. Each selection is applied with QOhosAppContext::setColorThemeMode(). A label shows the effective theme; it is initialized from QOhosAppContext::darkThemeActive() and updated through the QOhosAppContext::darkThemeActiveChanged() signal.
Files: