Warning, file /frameworks/kquickcharts/src/datasource/ArraySource.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002  * This file is part of KQuickCharts
0003  * SPDX-FileCopyrightText: 2019 Arjen Hiemstra <ahiemstra@heimr.nl>
0004  *
0005  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006  */
0007 
0008 #ifndef ARRAYSOURCE_H
0009 #define ARRAYSOURCE_H
0010 
0011 #include <QVariantList>
0012 
0013 #include "ChartDataSource.h"
0014 
0015 /**
0016  * A data source that provides entries of an array as data.
0017  */
0018 class ArraySource : public ChartDataSource
0019 {
0020     Q_OBJECT
0021     Q_PROPERTY(QVariantList array READ array WRITE setArray NOTIFY dataChanged)
0022     Q_PROPERTY(bool wrap READ wrap WRITE setWrap NOTIFY dataChanged)
0023 
0024 public:
0025     /**
0026      * Constructor
0027      *
0028      * @param parent TODO
0029      */
0030     explicit ArraySource(QObject *parent = nullptr);
0031 
0032     virtual int itemCount() const override;
0033     virtual QVariant item(int index) const override;
0034     QVariant minimum() const override;
0035     QVariant maximum() const override;
0036 
0037     QVariantList array() const;
0038     void setArray(const QVariantList &array);
0039 
0040     bool wrap() const;
0041     void setWrap(bool wrap);
0042 
0043 private:
0044     QVariantList m_array;
0045     bool m_wrap = false;
0046 };
0047 
0048 #endif // ARRAYSOURCE_H