1 | // Copyright (C) 2016 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 QtDataVisualization 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 SCATTERITEMMODELHANDLER_P_H |
15 | #define SCATTERITEMMODELHANDLER_P_H |
16 | |
17 | #include "abstractitemmodelhandler_p.h" |
18 | #include "qitemmodelscatterdataproxy_p.h" |
19 | |
20 | QT_BEGIN_NAMESPACE |
21 | |
22 | class ScatterItemModelHandler : public AbstractItemModelHandler |
23 | { |
24 | Q_OBJECT |
25 | public: |
26 | ScatterItemModelHandler(QItemModelScatterDataProxy *proxy, QObject *parent = 0); |
27 | virtual ~ScatterItemModelHandler(); |
28 | |
29 | public Q_SLOTS: |
30 | void handleDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, |
31 | const QList<int> &roles = QList<int>()) override; |
32 | void handleRowsInserted(const QModelIndex &parent, int start, int end) override; |
33 | void handleRowsRemoved(const QModelIndex &parent, int start, int end) override; |
34 | |
35 | protected: |
36 | void resolveModel() override; |
37 | |
38 | private: |
39 | void modelPosToScatterItem(int modelRow, int modelColumn, QScatterDataItem &item); |
40 | |
41 | QItemModelScatterDataProxy *m_proxy; // Not owned |
42 | QScatterDataArray *m_proxyArray; // Not owned |
43 | int m_xPosRole; |
44 | int m_yPosRole; |
45 | int m_zPosRole; |
46 | int m_rotationRole; |
47 | QRegularExpression m_xPosPattern; |
48 | QRegularExpression m_yPosPattern; |
49 | QRegularExpression m_zPosPattern; |
50 | QRegularExpression m_rotationPattern; |
51 | QString m_xPosReplace; |
52 | QString m_yPosReplace; |
53 | QString m_zPosReplace; |
54 | QString m_rotationReplace; |
55 | bool m_haveXPosPattern; |
56 | bool m_haveYPosPattern; |
57 | bool m_haveZPosPattern; |
58 | bool m_haveRotationPattern; |
59 | }; |
60 | |
61 | QT_END_NAMESPACE |
62 | |
63 | #endif |
64 | |