| 1 | // Copyright (C) 2016 The Qt Company Ltd. | 
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only | 
| 3 |  | 
| 4 | #ifndef QHXYMODELMAPPER_H | 
| 5 | #define QHXYMODELMAPPER_H | 
| 6 |  | 
| 7 | #include <QtCharts/QXYModelMapper> | 
| 8 |  | 
| 9 | Q_MOC_INCLUDE(<QtCharts/qxyseries.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 QHXYModelMapper : public QXYModelMapper | 
| 15 | { | 
| 16 |     Q_OBJECT | 
| 17 |     Q_PROPERTY(QXYSeries *series READ series WRITE setSeries NOTIFY seriesReplaced) | 
| 18 |     Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced) | 
| 19 |     Q_PROPERTY(int xRow READ xRow WRITE setXRow NOTIFY xRowChanged) | 
| 20 |     Q_PROPERTY(int yRow READ yRow WRITE setYRow NOTIFY yRowChanged) | 
| 21 |     Q_PROPERTY(int firstColumn READ firstColumn WRITE setFirstColumn NOTIFY firstColumnChanged) | 
| 22 |     Q_PROPERTY(int columnCount READ columnCount WRITE setColumnCount NOTIFY columnCountChanged) | 
| 23 |  | 
| 24 | public: | 
| 25 |     explicit QHXYModelMapper(QObject *parent = nullptr); | 
| 26 |  | 
| 27 |     QAbstractItemModel *model() const; | 
| 28 |     void setModel(QAbstractItemModel *model); | 
| 29 |  | 
| 30 |     QXYSeries *series() const; | 
| 31 |     void setSeries(QXYSeries *series); | 
| 32 |  | 
| 33 |     int xRow() const; | 
| 34 |     void setXRow(int xRow); | 
| 35 |  | 
| 36 |     int yRow() const; | 
| 37 |     void setYRow(int yRow); | 
| 38 |  | 
| 39 |     int firstColumn() const; | 
| 40 |     void setFirstColumn(int firstColumn); | 
| 41 |  | 
| 42 |     int columnCount() const; | 
| 43 |     void setColumnCount(int columnCount); | 
| 44 |  | 
| 45 | Q_SIGNALS: | 
| 46 |     void seriesReplaced(); | 
| 47 |     void modelReplaced(); | 
| 48 |     void xRowChanged(); | 
| 49 |     void yRowChanged(); | 
| 50 |     void firstColumnChanged(); | 
| 51 |     void columnCountChanged(); | 
| 52 | }; | 
| 53 |  | 
| 54 | QT_END_NAMESPACE | 
| 55 |  | 
| 56 | #endif // QHXYMODELMAPPER_H | 
| 57 |  |