Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquicktableview_p.h |
Source code | Switch to Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | /**************************************************************************** | - | ||||||
2 | ** | - | ||||||
3 | ** Copyright (C) 2018 The Qt Company Ltd. | - | ||||||
4 | ** Contact: https://www.qt.io/licensing/ | - | ||||||
5 | ** | - | ||||||
6 | ** This file is part of the QtQuick module of the Qt Toolkit. | - | ||||||
7 | ** | - | ||||||
8 | ** $QT_BEGIN_LICENSE:LGPL$ | - | ||||||
9 | ** Commercial License Usage | - | ||||||
10 | ** Licensees holding valid commercial Qt licenses may use this file in | - | ||||||
11 | ** accordance with the commercial license agreement provided with the | - | ||||||
12 | ** Software or, alternatively, in accordance with the terms contained in | - | ||||||
13 | ** a written agreement between you and The Qt Company. For licensing terms | - | ||||||
14 | ** and conditions see https://www.qt.io/terms-conditions. For further | - | ||||||
15 | ** information use the contact form at https://www.qt.io/contact-us. | - | ||||||
16 | ** | - | ||||||
17 | ** GNU Lesser General Public License Usage | - | ||||||
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - | ||||||
19 | ** General Public License version 3 as published by the Free Software | - | ||||||
20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the | - | ||||||
21 | ** packaging of this file. Please review the following information to | - | ||||||
22 | ** ensure the GNU Lesser General Public License version 3 requirements | - | ||||||
23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. | - | ||||||
24 | ** | - | ||||||
25 | ** GNU General Public License Usage | - | ||||||
26 | ** Alternatively, this file may be used under the terms of the GNU | - | ||||||
27 | ** General Public License version 2.0 or (at your option) the GNU General | - | ||||||
28 | ** Public license version 3 or any later version approved by the KDE Free | - | ||||||
29 | ** Qt Foundation. The licenses are as published by the Free Software | - | ||||||
30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 | - | ||||||
31 | ** included in the packaging of this file. Please review the following | - | ||||||
32 | ** information to ensure the GNU General Public License requirements will | - | ||||||
33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and | - | ||||||
34 | ** https://www.gnu.org/licenses/gpl-3.0.html. | - | ||||||
35 | ** | - | ||||||
36 | ** $QT_END_LICENSE$ | - | ||||||
37 | ** | - | ||||||
38 | ****************************************************************************/ | - | ||||||
39 | - | |||||||
40 | #ifndef QQUICKTABLEVIEW_P_H | - | ||||||
41 | #define QQUICKTABLEVIEW_P_H | - | ||||||
42 | - | |||||||
43 | // | - | ||||||
44 | // W A R N I N G | - | ||||||
45 | // ------------- | - | ||||||
46 | // | - | ||||||
47 | // This file is not part of the Qt API. It exists purely as an | - | ||||||
48 | // implementation detail. This header file may change from version to | - | ||||||
49 | // version without notice, or even be removed. | - | ||||||
50 | // | - | ||||||
51 | // We mean it. | - | ||||||
52 | // | - | ||||||
53 | - | |||||||
54 | #include <QtCore/qpointer.h> | - | ||||||
55 | #include <QtQuick/private/qtquickglobal_p.h> | - | ||||||
56 | #include <QtQuick/private/qquickflickable_p.h> | - | ||||||
57 | #include <QtQml/private/qqmlnullablevalue_p.h> | - | ||||||
58 | - | |||||||
59 | QT_BEGIN_NAMESPACE | - | ||||||
60 | - | |||||||
61 | class QQuickTableViewAttached; | - | ||||||
62 | class QQuickTableViewPrivate; | - | ||||||
63 | class QQmlChangeSet; | - | ||||||
64 | - | |||||||
65 | class Q_QUICK_PRIVATE_EXPORT QQuickTableView : public QQuickFlickable | - | ||||||
66 | { | - | ||||||
67 | Q_OBJECT | - | ||||||
68 | - | |||||||
69 | Q_PROPERTY(int rows READ rows NOTIFY rowsChanged) | - | ||||||
70 | Q_PROPERTY(int columns READ columns NOTIFY columnsChanged) | - | ||||||
71 | Q_PROPERTY(qreal rowSpacing READ rowSpacing WRITE setRowSpacing NOTIFY rowSpacingChanged) | - | ||||||
72 | Q_PROPERTY(qreal columnSpacing READ columnSpacing WRITE setColumnSpacing NOTIFY columnSpacingChanged) | - | ||||||
73 | Q_PROPERTY(qreal topMargin READ topMargin WRITE setTopMargin NOTIFY topMarginChanged) | - | ||||||
74 | Q_PROPERTY(qreal bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY bottomMarginChanged) | - | ||||||
75 | Q_PROPERTY(qreal leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged) | - | ||||||
76 | Q_PROPERTY(qreal rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged) | - | ||||||
77 | Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer NOTIFY cacheBufferChanged) | - | ||||||
78 | - | |||||||
79 | Q_PROPERTY(QVariant model READ model WRITE setModel NOTIFY modelChanged) | - | ||||||
80 | Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) | - | ||||||
81 | - | |||||||
82 | public: | - | ||||||
83 | QQuickTableView(QQuickItem *parent = nullptr); | - | ||||||
84 | - | |||||||
85 | int rows() const; | - | ||||||
86 | int columns() const; | - | ||||||
87 | - | |||||||
88 | qreal rowSpacing() const; | - | ||||||
89 | void setRowSpacing(qreal spacing); | - | ||||||
90 | - | |||||||
91 | qreal columnSpacing() const; | - | ||||||
92 | void setColumnSpacing(qreal spacing); | - | ||||||
93 | - | |||||||
94 | qreal topMargin() const; | - | ||||||
95 | void setTopMargin(qreal margin); | - | ||||||
96 | - | |||||||
97 | qreal bottomMargin() const; | - | ||||||
98 | void setBottomMargin(qreal margin); | - | ||||||
99 | - | |||||||
100 | qreal leftMargin() const; | - | ||||||
101 | void setLeftMargin(qreal margin); | - | ||||||
102 | - | |||||||
103 | qreal rightMargin() const; | - | ||||||
104 | void setRightMargin(qreal margin); | - | ||||||
105 | - | |||||||
106 | int cacheBuffer() const; | - | ||||||
107 | void setCacheBuffer(int newBuffer); | - | ||||||
108 | - | |||||||
109 | QVariant model() const; | - | ||||||
110 | void setModel(const QVariant &newModel); | - | ||||||
111 | - | |||||||
112 | QQmlComponent *delegate() const; | - | ||||||
113 | void setDelegate(QQmlComponent *); | - | ||||||
114 | - | |||||||
115 | static QQuickTableViewAttached *qmlAttachedProperties(QObject *); | - | ||||||
116 | - | |||||||
117 | Q_SIGNALS: | - | ||||||
118 | void rowsChanged(); | - | ||||||
119 | void columnsChanged(); | - | ||||||
120 | void rowSpacingChanged(); | - | ||||||
121 | void columnSpacingChanged(); | - | ||||||
122 | void topMarginChanged(); | - | ||||||
123 | void bottomMarginChanged(); | - | ||||||
124 | void leftMarginChanged(); | - | ||||||
125 | void rightMarginChanged(); | - | ||||||
126 | void cacheBufferChanged(); | - | ||||||
127 | void modelChanged(); | - | ||||||
128 | void delegateChanged(); | - | ||||||
129 | - | |||||||
130 | protected: | - | ||||||
131 | void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; | - | ||||||
132 | void viewportMoved(Qt::Orientations orientation) override; | - | ||||||
133 | void componentComplete() override; | - | ||||||
134 | - | |||||||
135 | private: | - | ||||||
136 | Q_DISABLE_COPY(QQuickTableView) | - | ||||||
137 | Q_DECLARE_PRIVATE(QQuickTableView) executed 710 times by 1 test: return reinterpret_cast<QQuickTableViewPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
executed 102 times by 1 test: return reinterpret_cast<const QQuickTableViewPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
| 102-710 | ||||||
138 | }; | - | ||||||
139 | - | |||||||
140 | class Q_QUICK_PRIVATE_EXPORT QQuickTableViewAttached : public QObject | - | ||||||
141 | { | - | ||||||
142 | Q_OBJECT | - | ||||||
143 | - | |||||||
144 | Q_PROPERTY(QQuickTableView *tableView READ tableView NOTIFY tableViewChanged) | - | ||||||
145 | Q_PROPERTY(qreal cellWidth READ cellWidth WRITE setCellWidth NOTIFY cellWidthChanged) | - | ||||||
146 | Q_PROPERTY(qreal cellHeight READ cellHeight WRITE setCellHeight NOTIFY cellHeightChanged) | - | ||||||
147 | Q_PROPERTY(int row READ row NOTIFY rowChanged) | - | ||||||
148 | Q_PROPERTY(int column READ column NOTIFY columnChanged) | - | ||||||
149 | - | |||||||
150 | public: | - | ||||||
151 | QQuickTableViewAttached(QObject *parent) | - | ||||||
152 | : QObject(parent) {} never executed: end of block | 0 | ||||||
153 | - | |||||||
154 | QQuickTableView *tableView() const { return m_tableview; } never executed: return m_tableview; | 0 | ||||||
155 | void setTableView(QQuickTableView *newTableView) { | - | ||||||
156 | if (newTableView == m_tableview)
| 0 | ||||||
157 | return; never executed: return; | 0 | ||||||
158 | m_tableview = newTableView; | - | ||||||
159 | Q_EMIT tableViewChanged(); | - | ||||||
160 | } never executed: end of block | 0 | ||||||
161 | - | |||||||
162 | qreal cellWidth() const { return m_cellWidth; } never executed: return m_cellWidth; | 0 | ||||||
163 | void setCellWidth(qreal newWidth) { | - | ||||||
164 | if (newWidth == m_cellWidth)
| 0 | ||||||
165 | return; never executed: return; | 0 | ||||||
166 | m_cellWidth = newWidth; | - | ||||||
167 | Q_EMIT cellWidthChanged(); | - | ||||||
168 | } never executed: end of block | 0 | ||||||
169 | - | |||||||
170 | qreal cellHeight() const { return m_cellHeight; } never executed: return m_cellHeight; | 0 | ||||||
171 | void setCellHeight(qreal newHeight) { | - | ||||||
172 | if (newHeight == m_cellHeight)
| 0 | ||||||
173 | return; never executed: return; | 0 | ||||||
174 | m_cellHeight = newHeight; | - | ||||||
175 | Q_EMIT cellHeightChanged(); | - | ||||||
176 | } never executed: end of block | 0 | ||||||
177 | - | |||||||
178 | int row() const { return m_row; } never executed: return m_row; | 0 | ||||||
179 | void setRow(int newRow) { | - | ||||||
180 | if (newRow == m_row)
| 0 | ||||||
181 | return; never executed: return; | 0 | ||||||
182 | m_row = newRow; | - | ||||||
183 | Q_EMIT rowChanged(); | - | ||||||
184 | } never executed: end of block | 0 | ||||||
185 | - | |||||||
186 | int column() const { return m_column; } never executed: return m_column; | 0 | ||||||
187 | void setColumn(int newColumn) { | - | ||||||
188 | if (newColumn == m_column)
| 0 | ||||||
189 | return; never executed: return; | 0 | ||||||
190 | m_column = newColumn; | - | ||||||
191 | Q_EMIT columnChanged(); | - | ||||||
192 | } never executed: end of block | 0 | ||||||
193 | - | |||||||
194 | Q_SIGNALS: | - | ||||||
195 | void tableViewChanged(); | - | ||||||
196 | void cellWidthChanged(); | - | ||||||
197 | void cellHeightChanged(); | - | ||||||
198 | void rowChanged(); | - | ||||||
199 | void columnChanged(); | - | ||||||
200 | - | |||||||
201 | private: | - | ||||||
202 | QPointer<QQuickTableView> m_tableview; | - | ||||||
203 | int m_row = -1; | - | ||||||
204 | int m_column = -1; | - | ||||||
205 | QQmlNullableValue<qreal> m_cellWidth; | - | ||||||
206 | QQmlNullableValue<qreal> m_cellHeight; | - | ||||||
207 | - | |||||||
208 | friend class QQuickTableViewPrivate; | - | ||||||
209 | }; | - | ||||||
210 | - | |||||||
211 | QT_END_NAMESPACE | - | ||||||
212 | - | |||||||
213 | QML_DECLARE_TYPE(QQuickTableView) | - | ||||||
214 | QML_DECLARE_TYPEINFO(QQuickTableView, QML_HAS_ATTACHED_PROPERTIES) | - | ||||||
215 | - | |||||||
216 | #endif // QQUICKTABLEVIEW_P_H | - | ||||||
Source code | Switch to Preprocessed file |