File indexing completed on 2025-04-27 04:08:14

0001 /*
0002  * This file is part of the KDE project
0003  * SPDX-FileCopyrightText: 2014 Arjen Hiemstra <ahiemstra@heimr.nl>
0004  *
0005  * SPDX-License-Identifier: GPL-2.0-or-later
0006  */
0007 
0008 #ifndef COLORDEPTHMODEL_H
0009 #define COLORDEPTHMODEL_H
0010 
0011 #include <QAbstractListModel>
0012 
0013 class ColorDepthModel : public QAbstractListModel
0014 {
0015     Q_OBJECT
0016     Q_PROPERTY(QString colorModelId READ colorModelId WRITE setColorModelId NOTIFY colorModelIdChanged)
0017 
0018 public:
0019     enum Roles {
0020         TextRole = Qt::UserRole + 1,
0021     };
0022 
0023     explicit ColorDepthModel(QObject *parent = nullptr);
0024     ~ColorDepthModel() override;
0025     QHash<int, QByteArray> roleNames() const override;
0026     QVariant data(const QModelIndex &index, int role) const override;
0027     int rowCount(const QModelIndex &parent) const override;
0028 
0029     QString colorModelId() const;
0030 
0031     Q_INVOKABLE QString id(int index);
0032     Q_INVOKABLE int indexOf(const QString& id);
0033 
0034 public Q_SLOTS:
0035     void setColorModelId(const QString& id);
0036 
0037 Q_SIGNALS:
0038     void colorModelIdChanged();
0039 
0040 private:
0041     class Private;
0042     Private * const d;
0043 };
0044 
0045 #endif // COLORDEPTHMODEL_H