From 25754bbe22bb444ca6c7def419de37bb6a7a9512 Mon Sep 17 00:00:00 2001 From: James Graham Date: Sun, 23 Apr 2023 12:44:52 +0000 Subject: [PATCH] Document colorschemer --- src/colorschemer.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/colorschemer.h b/src/colorschemer.h index bec8d6dd9..b3848b993 100644 --- a/src/colorschemer.h +++ b/src/colorschemer.h @@ -8,18 +8,53 @@ class QAbstractItemModel; class KColorSchemeManager; +/** + * @class ColorSchemer + * + * A class to provide a wrapper around KColorSchemeManager to make it available in + * QML. + * + * @sa KColorSchemeManager + */ class ColorSchemer : public QObject { Q_OBJECT + + /** + * @brief A QAbstractItemModel of all available color schemes. + * + * @sa QAbstractItemModel + */ Q_PROPERTY(QAbstractItemModel *model READ model CONSTANT) + public: ColorSchemer(QObject *parent = nullptr); ~ColorSchemer(); QAbstractItemModel *model() const; + + /** + * @brief Activates the KColorScheme identified by the provided index. + * + * @sa KColorScheme + */ Q_INVOKABLE void apply(int idx); + + /** + * @brief Activates the KColorScheme with the given name. + * + * @sa KColorScheme + */ 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; + + /** + * @brief Returns the name for the scheme with the given index. + */ Q_INVOKABLE QString nameForIndex(int index) const; private: