KQuickCharts

ChartDataSource.h
1/*
2 * This file is part of KQuickCharts
3 * SPDX-FileCopyrightText: 2019 Arjen Hiemstra <ahiemstra@heimr.nl>
4 *
5 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6 */
7
8#ifndef DATASOURCE_H
9#define DATASOURCE_H
10
11#include <QObject>
12#include <qqmlregistration.h>
13
14#include "quickcharts_export.h"
15
16/**
17 * Abstract base class for data sources.
18 */
19class QUICKCHARTS_EXPORT ChartDataSource : public QObject
20{
21 Q_OBJECT
22 QML_NAMED_ELEMENT(DataSource)
23 QML_UNCREATABLE("Abstract Base Class")
24
25public:
26 explicit ChartDataSource(QObject *parent = nullptr);
27 virtual ~ChartDataSource() = default;
28
29 virtual int itemCount() const = 0;
30 virtual QVariant item(int index) const = 0;
31 virtual QVariant minimum() const = 0;
32 virtual QVariant maximum() const = 0;
33
34 virtual QVariant first() const;
35
36 Q_SIGNAL void dataChanged();
37
38protected:
39 static bool variantCompare(const QVariant &lhs, const QVariant &rhs);
40};
41
42#endif // DATASOURCE_H
Abstract base class for data sources.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:53 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.