1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QVBARMODELMAPPER_H
5#define QVBARMODELMAPPER_H
6
7#include <QtCharts/QBarModelMapper>
8Q_MOC_INCLUDE(<QtCore/qabstractitemmodel.h>)
9
10QT_BEGIN_NAMESPACE
11/* Comment line for syncqt to generate the fwd-include correctly, due to QTBUG-22432 */
12class Q_CHARTS_EXPORT QVBarModelMapper : public QBarModelMapper
13{
14 Q_OBJECT
15 Q_PROPERTY(QAbstractBarSeries *series READ series WRITE setSeries NOTIFY seriesReplaced)
16 Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced)
17 Q_PROPERTY(int firstBarSetColumn READ firstBarSetColumn WRITE setFirstBarSetColumn NOTIFY firstBarSetColumnChanged)
18 Q_PROPERTY(int lastBarSetColumn READ lastBarSetColumn WRITE setLastBarSetColumn NOTIFY lastBarSetColumnChanged)
19 Q_PROPERTY(int firstRow READ firstRow WRITE setFirstRow NOTIFY firstRowChanged)
20 Q_PROPERTY(int rowCount READ rowCount WRITE setRowCount NOTIFY rowCountChanged)
21
22public:
23 explicit QVBarModelMapper(QObject *parent = nullptr);
24
25 QAbstractItemModel *model() const;
26 void setModel(QAbstractItemModel *model);
27
28 QAbstractBarSeries *series() const;
29 void setSeries(QAbstractBarSeries *series);
30
31 int firstBarSetColumn() const;
32 void setFirstBarSetColumn(int firstBarSetColumn);
33
34 int lastBarSetColumn() const;
35 void setLastBarSetColumn(int lastBarSetColumn);
36
37 int firstRow() const;
38 void setFirstRow(int firstRow);
39
40 int rowCount() const;
41 void setRowCount(int rowCount);
42
43Q_SIGNALS:
44 void seriesReplaced();
45 void modelReplaced();
46 void firstBarSetColumnChanged();
47 void lastBarSetColumnChanged();
48 void firstRowChanged();
49 void rowCountChanged();
50};
51
52QT_END_NAMESPACE
53
54#endif // QVBARMODELMAPPER_H
55

source code of qtcharts/src/charts/barchart/qvbarmodelmapper.h