Document colorschemer
This commit is contained in:
@@ -8,18 +8,53 @@
|
|||||||
class QAbstractItemModel;
|
class QAbstractItemModel;
|
||||||
class KColorSchemeManager;
|
class KColorSchemeManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @class ColorSchemer
|
||||||
|
*
|
||||||
|
* A class to provide a wrapper around KColorSchemeManager to make it available in
|
||||||
|
* QML.
|
||||||
|
*
|
||||||
|
* @sa KColorSchemeManager
|
||||||
|
*/
|
||||||
class ColorSchemer : public QObject
|
class ColorSchemer : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief A QAbstractItemModel of all available color schemes.
|
||||||
|
*
|
||||||
|
* @sa QAbstractItemModel
|
||||||
|
*/
|
||||||
Q_PROPERTY(QAbstractItemModel *model READ model CONSTANT)
|
Q_PROPERTY(QAbstractItemModel *model READ model CONSTANT)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ColorSchemer(QObject *parent = nullptr);
|
ColorSchemer(QObject *parent = nullptr);
|
||||||
~ColorSchemer();
|
~ColorSchemer();
|
||||||
|
|
||||||
QAbstractItemModel *model() const;
|
QAbstractItemModel *model() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Activates the KColorScheme identified by the provided index.
|
||||||
|
*
|
||||||
|
* @sa KColorScheme
|
||||||
|
*/
|
||||||
Q_INVOKABLE void apply(int idx);
|
Q_INVOKABLE void apply(int idx);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Activates the KColorScheme with the given name.
|
||||||
|
*
|
||||||
|
* @sa KColorScheme
|
||||||
|
*/
|
||||||
Q_INVOKABLE void apply(const QString &name);
|
Q_INVOKABLE void apply(const QString &name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the index for the scheme with the given name.
|
||||||
|
*/
|
||||||
Q_INVOKABLE int indexForScheme(const QString &name) const;
|
Q_INVOKABLE int indexForScheme(const QString &name) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the name for the scheme with the given index.
|
||||||
|
*/
|
||||||
Q_INVOKABLE QString nameForIndex(int index) const;
|
Q_INVOKABLE QString nameForIndex(int index) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user