KQuickCharts

SingleValueSource.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 SINGLEVALUESOURCE_H
9#define SINGLEVALUESOURCE_H
10
11#include <QVariant>
12
13#include "ChartDataSource.h"
14
15/**
16 * A data source that provides a single value as data.
17 */
18class QUICKCHARTS_EXPORT SingleValueSource : public ChartDataSource
19{
20 Q_OBJECT
21 QML_ELEMENT
22
23public:
24 explicit SingleValueSource(QObject *parent = nullptr);
25
26 int itemCount() const override;
27 QVariant item(int index) const override;
28 QVariant minimum() const override;
29 QVariant maximum() const override;
30
31 Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY dataChanged)
32 QVariant value() const;
33 void setValue(const QVariant &value);
34
35private:
36 QVariant m_value;
37};
38
39#endif // SINGLEVALUESOURCE_H
Abstract base class for data sources.
A data source that provides a single value as data.
Q_PROPERTY(...)
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.