KColorScheme
kcolorschememanager.cpp
47 if (qgetenv("XDG_CURRENT_DESKTOP") == "KDE" && QGuiApplicationPrivate::platformTheme()->name() == QLatin1String("xdgdesktopportal")) {
56 // hint for plasma-integration to synchronize the color scheme with the window manager/compositor
63 qApp->setPalette(KColorScheme::createApplicationPalette(KSharedConfig::openConfig(colorSchemePath)));
87// On other platforms we automatically apply Breeze/Breeze Dark depending on the system preference
159 QObject::connect(&*d->m_colorSchemeWatcher, &KColorSchemeWatcher::systemPreferenceChanged, this, [this]() {
QAbstractItemModel * model() const
A QAbstractItemModel of all available color schemes.
Definition kcolorschememanager.cpp:196
QString activeSchemeId() const
Returns the id of the currently active scheme or an empty string if the default scheme is active.
Definition kcolorschememanager.cpp:274
QModelIndex indexForScheme(const QString &name) const
Returns the model index for the scheme with the given name.
Definition kcolorschememanager.cpp:226
QModelIndex indexForSchemeId(const QString &id) const
Returns the model index for the scheme with the given id.
Definition kcolorschememanager.cpp:221
static KColorSchemeManager * instance()
Returns the manager for the current application instance.
Definition kcolorschememanager.cpp:284
void activateScheme(const QModelIndex &index)
Activates the KColorScheme identified by the provided index.
Definition kcolorschememanager.cpp:241
QString activeSchemeName() const
Returns the name of the currently active scheme or an empty string if the default scheme is active.
Definition kcolorschememanager.cpp:279
void saveSchemeToConfigFile(const QString &schemeName) const
Saves the color scheme to config file.
Definition kcolorschememanager.cpp:260
void setAutosaveChanges(bool autosaveChanges)
Sets color scheme autosaving.
Definition kcolorschememanager.cpp:216
A model listing the KColorSchemes available in the system.
Definition kcolorschememodel.h:27
PreferHighContrast
PreferLight
PreferDark
void systemPreferenceChanged()
static QPalette createApplicationPalette(const KSharedConfigPtr &config)
Used to obtain the QPalette that will be used to set the application palette from KDE Platform theme.
Definition kcolorscheme.cpp:658
void revertToDefault(const char *key, WriteConfigFlags pFlag=WriteConfigFlags())
bool hasDefault(const char *key) const
void writeEntry(const char *key, const char *value, WriteConfigFlags pFlags=Normal)
bool sync() override
SimpleConfig
static QString removeAcceleratorMarker(const QString &label)
QString name(StandardAction id)
QCA_EXPORT void init()
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const=0
void addPixmap(const QPixmap &pixmap, Mode mode, State state)
QVariant data(int role) const const
bool isValid() const const
const QAbstractItemModel * model() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
bool begin(QPaintDevice *device)
bool end()
void fillRect(const QRect &rectangle, QGradient::Preset preset)
Active
QChar * data()
bool isEmpty() const const
black
QString toString() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 25 2025 11:57:11 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 25 2025 11:57:11 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.