Alkimia API

alkonlinequotesmodel.h
1/*
2 * SPDX-FileCopyrightText: 2024 Ralf Habacker ralf.habacker@freenet.de
3 * SPDX-License-Identifier: LGPL-2.1-or-later
4 *
5 * This file is part of libalkimia.
6 */
7
8#ifndef ALKONLINEQUOTESMODEL_H
9#define ALKONLINEQUOTESMODEL_H
10
11#include <QAbstractItemModel>
12#include <QStringList>
13
14class AlkOnlineQuotesProfile;
15
16class AlkOnlineQuotesModel : public QAbstractTableModel
17{
19public:
20 enum Columns {
21 Name,
22 Source,
23 DataFormat,
24 ReferenceTo
25 };
26
27 enum Roles {
28 NameRole = Qt::UserRole
29 };
30
31 explicit AlkOnlineQuotesModel(AlkOnlineQuotesProfile *profile);
32 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
33 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
34 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
35 Qt::ItemFlags flags(const QModelIndex &index) const override;
36 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
37 bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
38 bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
39
40 void setProfile(AlkOnlineQuotesProfile* profile);
41
42public Q_SLOTS:
43 void slotSourcesChanged();
44
45protected:
46 AlkOnlineQuotesProfile *_profile;
47 QStringList _sourceNames;
48};
49
50#endif // ALKONLINEQUOTESMODEL_H
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
QObject * parent() const const
UserRole
typedef ItemFlags
Orientation
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.