Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquicklistview_p.h |
Source code | Switch to Preprocessed file |
Line | Source | Count |
---|---|---|
1 | /**************************************************************************** | - |
2 | ** | - |
3 | ** Copyright (C) 2016 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 QQUICKLISTVIEW_P_H | - |
41 | #define QQUICKLISTVIEW_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 <private/qtquickglobal_p.h> | - |
55 | - | |
56 | QT_REQUIRE_CONFIG(quick_listview); | - |
57 | - | |
58 | #include "qquickitemview_p.h" | - |
59 | - | |
60 | #include <private/qtquickglobal_p.h> | - |
61 | - | |
62 | QT_BEGIN_NAMESPACE | - |
63 | - | |
64 | class QQuickListView; | - |
65 | class QQuickListViewPrivate; | - |
66 | class Q_QUICK_PRIVATE_EXPORT QQuickViewSection : public QObject | - |
67 | { | - |
68 | Q_OBJECT | - |
69 | Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY propertyChanged) | - |
70 | Q_PROPERTY(SectionCriteria criteria READ criteria WRITE setCriteria NOTIFY criteriaChanged) | - |
71 | Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) | - |
72 | Q_PROPERTY(int labelPositioning READ labelPositioning WRITE setLabelPositioning NOTIFY labelPositioningChanged) | - |
73 | public: | - |
74 | QQuickViewSection(QQuickListView *parent=nullptr); | - |
75 | - | |
76 | QString property() const { return m_property; } executed 7532 times by 4 tests: return m_property; Executed by:
| 7532 |
77 | void setProperty(const QString &); | - |
78 | - | |
79 | enum SectionCriteria { FullString, FirstCharacter }; | - |
80 | Q_ENUM(SectionCriteria) | - |
81 | SectionCriteria criteria() const { return m_criteria; } never executed: return m_criteria; | 0 |
82 | void setCriteria(SectionCriteria); | - |
83 | - | |
84 | QQmlComponent *delegate() const { return m_delegate; } executed 8561 times by 4 tests: return m_delegate; Executed by:
| 8561 |
85 | void setDelegate(QQmlComponent *delegate); | - |
86 | - | |
87 | QString sectionString(const QString &value); | - |
88 | - | |
89 | enum LabelPositioning { InlineLabels = 0x01, CurrentLabelAtStart = 0x02, NextLabelAtEnd = 0x04 }; | - |
90 | Q_ENUM(LabelPositioning) | - |
91 | int labelPositioning() const { return m_labelPositioning; } executed 17179 times by 4 tests: return m_labelPositioning; Executed by:
| 17179 |
92 | void setLabelPositioning(int pos); | - |
93 | - | |
94 | Q_SIGNALS: | - |
95 | void sectionsChanged(); | - |
96 | void propertyChanged(); | - |
97 | void criteriaChanged(); | - |
98 | void delegateChanged(); | - |
99 | void labelPositioningChanged(); | - |
100 | - | |
101 | private: | - |
102 | QString m_property; | - |
103 | SectionCriteria m_criteria; | - |
104 | QQmlComponent *m_delegate; | - |
105 | int m_labelPositioning; | - |
106 | QQuickListViewPrivate *m_view; | - |
107 | }; | - |
108 | - | |
109 | - | |
110 | class QQmlInstanceModel; | - |
111 | class QQuickListViewAttached; | - |
112 | class Q_QUICK_PRIVATE_EXPORT QQuickListView : public QQuickItemView | - |
113 | { | - |
114 | Q_OBJECT | - |
115 | Q_DECLARE_PRIVATE(QQuickListView) executed 16292 times by 9 tests: return reinterpret_cast<QQuickListViewPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
executed 1087068 times by 11 tests: return reinterpret_cast<const QQuickListViewPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
| 16292-1087068 |
116 | - | |
117 | Q_PROPERTY(qreal highlightMoveVelocity READ highlightMoveVelocity WRITE setHighlightMoveVelocity NOTIFY highlightMoveVelocityChanged) | - |
118 | Q_PROPERTY(qreal highlightResizeVelocity READ highlightResizeVelocity WRITE setHighlightResizeVelocity NOTIFY highlightResizeVelocityChanged) | - |
119 | Q_PROPERTY(int highlightResizeDuration READ highlightResizeDuration WRITE setHighlightResizeDuration NOTIFY highlightResizeDurationChanged) | - |
120 | - | |
121 | Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing NOTIFY spacingChanged) | - |
122 | Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged) | - |
123 | - | |
124 | Q_PROPERTY(QQuickViewSection *section READ sectionCriteria CONSTANT) | - |
125 | Q_PROPERTY(QString currentSection READ currentSection NOTIFY currentSectionChanged) | - |
126 | - | |
127 | Q_PROPERTY(SnapMode snapMode READ snapMode WRITE setSnapMode NOTIFY snapModeChanged) | - |
128 | - | |
129 | Q_PROPERTY(HeaderPositioning headerPositioning READ headerPositioning WRITE setHeaderPositioning NOTIFY headerPositioningChanged REVISION 2) | - |
130 | Q_PROPERTY(FooterPositioning footerPositioning READ footerPositioning WRITE setFooterPositioning NOTIFY footerPositioningChanged REVISION 2) | - |
131 | - | |
132 | Q_CLASSINFO("DefaultProperty", "data") | - |
133 | - | |
134 | public: | - |
135 | QQuickListView(QQuickItem *parent=nullptr); | - |
136 | ~QQuickListView(); | - |
137 | - | |
138 | qreal spacing() const; | - |
139 | void setSpacing(qreal spacing); | - |
140 | - | |
141 | enum Orientation { Horizontal = Qt::Horizontal, Vertical = Qt::Vertical }; | - |
142 | Q_ENUM(Orientation) | - |
143 | Orientation orientation() const; | - |
144 | void setOrientation(Orientation); | - |
145 | - | |
146 | QQuickViewSection *sectionCriteria(); | - |
147 | QString currentSection() const; | - |
148 | - | |
149 | void setHighlightFollowsCurrentItem(bool) override; | - |
150 | - | |
151 | qreal highlightMoveVelocity() const; | - |
152 | void setHighlightMoveVelocity(qreal); | - |
153 | - | |
154 | qreal highlightResizeVelocity() const; | - |
155 | void setHighlightResizeVelocity(qreal); | - |
156 | - | |
157 | int highlightResizeDuration() const; | - |
158 | void setHighlightResizeDuration(int); | - |
159 | - | |
160 | void setHighlightMoveDuration(int) override; | - |
161 | - | |
162 | enum SnapMode { NoSnap, SnapToItem, SnapOneItem }; | - |
163 | Q_ENUM(SnapMode) | - |
164 | SnapMode snapMode() const; | - |
165 | void setSnapMode(SnapMode mode); | - |
166 | - | |
167 | enum HeaderPositioning { InlineHeader, OverlayHeader, PullBackHeader }; | - |
168 | Q_ENUM(HeaderPositioning) | - |
169 | HeaderPositioning headerPositioning() const; | - |
170 | void setHeaderPositioning(HeaderPositioning positioning); | - |
171 | - | |
172 | enum FooterPositioning { InlineFooter, OverlayFooter, PullBackFooter }; | - |
173 | Q_ENUM(FooterPositioning) | - |
174 | FooterPositioning footerPositioning() const; | - |
175 | void setFooterPositioning(FooterPositioning positioning); | - |
176 | - | |
177 | static QQuickListViewAttached *qmlAttachedProperties(QObject *); | - |
178 | - | |
179 | public Q_SLOTS: | - |
180 | void incrementCurrentIndex(); | - |
181 | void decrementCurrentIndex(); | - |
182 | - | |
183 | Q_SIGNALS: | - |
184 | void spacingChanged(); | - |
185 | void orientationChanged(); | - |
186 | void currentSectionChanged(); | - |
187 | void highlightMoveVelocityChanged(); | - |
188 | void highlightResizeVelocityChanged(); | - |
189 | void highlightResizeDurationChanged(); | - |
190 | void snapModeChanged(); | - |
191 | Q_REVISION(2) void headerPositioningChanged(); | - |
192 | Q_REVISION(2) void footerPositioningChanged(); | - |
193 | - | |
194 | protected: | - |
195 | void viewportMoved(Qt::Orientations orient) override; | - |
196 | void keyPressEvent(QKeyEvent *) override; | - |
197 | void geometryChanged(const QRectF &newGeometry,const QRectF &oldGeometry) override; | - |
198 | void initItem(int index, QObject *item) override; | - |
199 | qreal maxYExtent() const override; | - |
200 | qreal maxXExtent() const override; | - |
201 | }; | - |
202 | - | |
203 | class QQuickListViewAttached : public QQuickItemViewAttached | - |
204 | { | - |
205 | Q_OBJECT | - |
206 | - | |
207 | public: | - |
208 | QQuickListViewAttached(QObject *parent) | - |
209 | : QQuickItemViewAttached(parent), m_sectionItem(nullptr) {} executed 32708 times by 10 tests: end of block Executed by:
| 32708 |
210 | ~QQuickListViewAttached() {} | - |
211 | - | |
212 | public: | - |
213 | QPointer<QQuickItem> m_sectionItem; | - |
214 | }; | - |
215 | - | |
216 | - | |
217 | QT_END_NAMESPACE | - |
218 | - | |
219 | QML_DECLARE_TYPEINFO(QQuickListView, QML_HAS_ATTACHED_PROPERTIES) | - |
220 | QML_DECLARE_TYPE(QQuickListView) | - |
221 | QML_DECLARE_TYPE(QQuickViewSection) | - |
222 | - | |
223 | #endif // QQUICKLISTVIEW_P_H | - |
Source code | Switch to Preprocessed file |