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