KQuickCharts

ArraySource.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 ARRAYSOURCE_H
9#define ARRAYSOURCE_H
10
11#include <QVariantList>
12
13#include "ChartDataSource.h"
14
15/**
16 * A data source that provides entries of an array as data.
17 */
18class QUICKCHARTS_EXPORT ArraySource : public ChartDataSource
19{
20 Q_OBJECT
21 QML_ELEMENT
22
23public:
24 /**
25 * Constructor
26 *
27 * @param parent TODO
28 */
29 explicit ArraySource(QObject *parent = nullptr);
30
31 int itemCount() const override;
32 QVariant item(int index) const override;
33 QVariant minimum() const override;
34 QVariant maximum() const override;
35
36 Q_PROPERTY(QVariantList array READ array WRITE setArray NOTIFY dataChanged)
37 QVariantList array() const;
38 void setArray(const QVariantList &array);
39
40 Q_PROPERTY(bool wrap READ wrap WRITE setWrap NOTIFY dataChanged)
41 bool wrap() const;
42 void setWrap(bool wrap);
43
44private:
45 QVariantList m_array;
46 bool m_wrap = false;
47};
48
49#endif // ARRAYSOURCE_H
A data source that provides entries of an array as data.
Definition ArraySource.h:19
Abstract base class for data sources.
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.