MauiKit TextEditor

colorschemesmodel.h
1#pragma once
2#include <QObject>
3#include <QAbstractListModel>
4#include <QQmlParserStatus>
5#include <QQmlEngine>
6
7#include <KSyntaxHighlighting/Repository>
8#include <KSyntaxHighlighting/Theme>
9
10class ColorSchemesModel : public QAbstractListModel, public QQmlParserStatus
11{
14 QML_ELEMENT
15
16public:
17
18 enum Role
19 {
20 Name,
21 Foreground,
22 Background,
24 Color3,
25 Color4,
26 Color5
27 };
28
29
30 ColorSchemesModel(QObject * parent = nullptr);
31
32 // QQmlParserStatus interface
33public:
34 void classBegin() override final;
35 void componentComplete() override final;
36
37private:
38 QVector<KSyntaxHighlighting::Theme> m_list;
39 void setList();
40
41 // QAbstractItemModel interface
42public:
43 int rowCount(const QModelIndex &parent) const override final;
44 QVariant data(const QModelIndex &index, int role) const override final;
45 QHash<int, QByteArray> roleNames() const override final;
46};
47
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
Q_INTERFACES(...)
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:09 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.