1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4//
5// W A R N I N G
6// -------------
7//
8// This file is not part of the QtGraphs API. It exists purely as an
9// implementation detail. This header file may change from version to
10// version without notice, or even be removed.
11//
12// We mean it.
13
14#ifndef QBARDATAPROXY_P_H
15#define QBARDATAPROXY_P_H
16
17#include "qbardataproxy.h"
18#include "qabstractdataproxy_p.h"
19
20QT_BEGIN_NAMESPACE
21
22class QBarDataProxyPrivate : public QAbstractDataProxyPrivate
23{
24 Q_DECLARE_PUBLIC(QBarDataProxy)
25
26public:
27 QBarDataProxyPrivate(QBarDataProxy *q);
28 virtual ~QBarDataProxyPrivate();
29
30 void resetArray(QBarDataArray *newArray, const QStringList *rowLabels,
31 const QStringList *columnLabels);
32 void setRow(int rowIndex, QBarDataRow *row, const QString *label);
33 void setRows(int rowIndex, const QBarDataArray &rows, const QStringList *labels);
34 void setItem(int rowIndex, int columnIndex, const QBarDataItem &item);
35 int addRow(QBarDataRow *row, const QString *label);
36 int addRows(const QBarDataArray &rows, const QStringList *labels);
37 void insertRow(int rowIndex, QBarDataRow *row, const QString *label);
38 void insertRows(int rowIndex, const QBarDataArray &rows, const QStringList *labels);
39 void removeRows(int rowIndex, int removeCount, bool removeLabels);
40
41 QPair<float, float> limitValues(int startRow, int startColumn, int rowCount,
42 int columnCount) const;
43
44 void setSeries(QAbstract3DSeries *series) override;
45
46private:
47 void clearRow(int rowIndex);
48 void clearArray();
49 void fixRowLabels(int startIndex, int count, const QStringList &newLabels, bool isInsert);
50
51 QBarDataArray *m_dataArray;
52 QStringList m_rowLabels;
53 QStringList m_columnLabels;
54};
55
56QT_END_NAMESPACE
57
58#endif
59

source code of qtgraphs/src/graphs/data/qbardataproxy_p.h