KColorSchemeWatcher Class

Information about system-wide color preferences. More...

Header: #include <KColorSchemeWatcher>
CMake: find_package(KF6 REQUIRED COMPONENTS GuiAddons)
target_link_libraries(mytarget PRIVATE KF6::GuiAddons)
Inherits: QObject

Public Types

enum ColorPreference { NoPreference, PreferDark, PreferLight, PreferHighContrast }

Public Functions

KColorSchemeWatcher(QObject *parent = nullptr)
KColorSchemeWatcher::ColorPreference systemPreference() const

Signals

Detailed Description

Member Type Documentation

enum KColorSchemeWatcher::ColorPreference

Encodes the color preference of the user to be used by applications as configured in the system settings. On some systems not all values are returned, e.g. PreferHighContrast is currently only returned on Windows.

ConstantValueDescription
KColorSchemeWatcher::NoPreference0No preference available
KColorSchemeWatcher::PreferDark1The user prefers a dark color scheme
KColorSchemeWatcher::PreferLight2The user prefers a light color scheme
KColorSchemeWatcher::PreferHighContrast (since 6.13)3The user prefers a system-provided high-contrast color scheme

See also systemPreference.

Member Function Documentation

KColorSchemeWatcher::KColorSchemeWatcher(QObject *parent = nullptr)

KColorSchemeWatcher::ColorPreference KColorSchemeWatcher::systemPreference() const

The system-wide color preference.

[signal] void KColorSchemeWatcher::systemPreferenceChanged()

Emitted when systemPreference changes.