KWin
|
#include <effectsmodel.h>
Classes | |
struct | EffectData |
Public Types | |
enum | AdditionalRoles { NameRole = Qt::UserRole + 1 , DescriptionRole , AuthorNameRole , AuthorEmailRole , LicenseRole , VersionRole , CategoryRole , ServiceNameRole , IconNameRole , StatusRole , VideoRole , WebsiteRole , SupportedRole , ExclusiveRole , InternalRole , ConfigurableRole , EnabledByDefaultRole , ConfigModuleRole , EnabledByDefaultFunctionRole } |
enum class | Status { Disabled = Qt::Unchecked , EnabledUndeterminded = Qt::PartiallyChecked , Enabled = Qt::Checked } |
enum class | LoadOptions { None , KeepDirty } |
Signals | |
void | loaded () |
Public Member Functions | |
EffectsModel (QObject *parent=nullptr) | |
QHash< int, QByteArray > | roleNames () const override |
QModelIndex | index (int row, int column, const QModelIndex &parent={}) const override |
QModelIndex | parent (const QModelIndex &child) const override |
int | rowCount (const QModelIndex &parent={}) const override |
int | columnCount (const QModelIndex &parent={}) const override |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
void | updateEffectStatus (const QModelIndex &rowIndex, Status effectState) |
void | load (LoadOptions options=LoadOptions::None) |
void | save () |
void | defaults () |
bool | isDefaults () const |
bool | needsSave () const |
QModelIndex | findByPluginId (const QString &pluginId) const |
void | requestConfigure (const QModelIndex &index, QWindow *transientParent) |
Protected Member Functions | |
virtual bool | shouldStore (const EffectData &data) const |
Definition at line 25 of file effectsmodel.h.
This enum type is used to specify data roles.
Definition at line 33 of file effectsmodel.h.
|
strong |
This enum type is used to specify load options.
Enumerator | |
---|---|
None | |
KeepDirty | Do not discard unsaved changes when reloading the model. |
Definition at line 157 of file effectsmodel.h.
|
strong |
This enum type is used to specify the status of a given effect.
Definition at line 117 of file effectsmodel.h.
|
explicit |
Definition at line 69 of file effectsmodel.cpp.
|
override |
Definition at line 112 of file effectsmodel.cpp.
|
override |
Definition at line 125 of file effectsmodel.cpp.
void KWin::EffectsModel::defaults | ( | ) |
Resets the status of each effect to the default state.
Definition at line 541 of file effectsmodel.cpp.
QModelIndex KWin::EffectsModel::findByPluginId | ( | const QString & | pluginId | ) | const |
Finds an effect with the given plugin id.
Definition at line 574 of file effectsmodel.cpp.
|
override |
Definition at line 98 of file effectsmodel.cpp.
bool KWin::EffectsModel::isDefaults | ( | ) | const |
Whether the status of each effect is its default state.
Definition at line 553 of file effectsmodel.cpp.
void KWin::EffectsModel::load | ( | LoadOptions | options = LoadOptions::None | ) |
Loads effects.
You have to call this method in order to populate the model.
Definition at line 377 of file effectsmodel.cpp.
|
signal |
This signal is emitted when the model is loaded or reloaded.
bool KWin::EffectsModel::needsSave | ( | ) | const |
Whether the model has unsaved changes.
Definition at line 566 of file effectsmodel.cpp.
|
override |
Definition at line 107 of file effectsmodel.cpp.
void KWin::EffectsModel::requestConfigure | ( | const QModelIndex & | index, |
QWindow * | transientParent ) |
Shows a configuration dialog for a given effect.
index | An effect represented by the given index. |
transientParent | The transient parent of the configuration dialog. |
Definition at line 586 of file effectsmodel.cpp.
|
override |
Definition at line 74 of file effectsmodel.cpp.
|
override |
Definition at line 117 of file effectsmodel.cpp.
void KWin::EffectsModel::save | ( | ) |
Saves status of each modified effect.
Definition at line 484 of file effectsmodel.cpp.
|
override |
Definition at line 177 of file effectsmodel.cpp.
|
protectedvirtual |
Returns whether the given effect should be stored in the model.
data | The effect. |
true
if the effect should be stored, otherwise false
. Reimplemented in KWin::AnimationsModel.
Definition at line 603 of file effectsmodel.cpp.
void KWin::EffectsModel::updateEffectStatus | ( | const QModelIndex & | rowIndex, |
Status | effectState ) |
Changes the status of a given effect.
rowIndex | An effect represented by the given index. |
effectState | The new state. |
Definition at line 479 of file effectsmodel.cpp.