Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/types/qqmlmodelindexvaluetype_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 QtQml 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 QQMLMODELINDEXVALUETYPE_P_H | - |
41 | #define QQMLMODELINDEXVALUETYPE_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/qabstractitemmodel.h> | - |
55 | #include <QtCore/qitemselectionmodel.h> | - |
56 | - | |
57 | QT_BEGIN_NAMESPACE | - |
58 | - | |
59 | struct QQmlModelIndexValueType | - |
60 | { | - |
61 | QModelIndex v; | - |
62 | - | |
63 | Q_PROPERTY(int row READ row CONSTANT FINAL) | - |
64 | Q_PROPERTY(int column READ column CONSTANT FINAL) | - |
65 | Q_PROPERTY(QModelIndex parent READ parent FINAL) | - |
66 | Q_PROPERTY(bool valid READ isValid CONSTANT FINAL) | - |
67 | Q_PROPERTY(QAbstractItemModel *model READ model CONSTANT FINAL) | - |
68 | Q_PROPERTY(quint64 internalId READ internalId CONSTANT FINAL) | - |
69 | Q_GADGET | - |
70 | - | |
71 | public: | - |
72 | Q_INVOKABLE QString toString() const | - |
73 | { return QLatin1String("QModelIndex") + propertiesString(v); } executed 4 times by 1 test: return QLatin1String("QModelIndex") + propertiesString(v); Executed by:
| 4 |
74 | - | |
75 | inline int row() const Q_DECL_NOTHROW { return v.row(); } executed 10 times by 1 test: return v.row(); Executed by:
| 10 |
76 | inline int column() const Q_DECL_NOTHROW { return v.column(); } executed 10 times by 1 test: return v.column(); Executed by:
| 10 |
77 | inline QModelIndex parent() const { return v.parent(); } executed 10 times by 1 test: return v.parent(); Executed by:
| 10 |
78 | inline bool isValid() const Q_DECL_NOTHROW { return v.isValid(); } executed 10 times by 1 test: return v.isValid(); Executed by:
| 10 |
79 | inline QAbstractItemModel *model() const Q_DECL_NOTHROW | - |
80 | { return const_cast<QAbstractItemModel *>(v.model()); } executed 10 times by 1 test: return const_cast<QAbstractItemModel *>(v.model()); Executed by:
| 10 |
81 | quint64 internalId() const { return v.internalId(); } executed 10 times by 1 test: return v.internalId(); Executed by:
| 10 |
82 | - | |
83 | static QString propertiesString(const QModelIndex &idx); | - |
84 | - | |
85 | static QPersistentModelIndex toPersistentModelIndex(const QModelIndex &index) | - |
86 | { return QPersistentModelIndex(index); } never executed: return QPersistentModelIndex(index); | 0 |
87 | }; | - |
88 | - | |
89 | struct QQmlPersistentModelIndexValueType | - |
90 | { | - |
91 | QPersistentModelIndex v; | - |
92 | - | |
93 | Q_PROPERTY(int row READ row FINAL) | - |
94 | Q_PROPERTY(int column READ column FINAL) | - |
95 | Q_PROPERTY(QModelIndex parent READ parent FINAL) | - |
96 | Q_PROPERTY(bool valid READ isValid FINAL) | - |
97 | Q_PROPERTY(QAbstractItemModel *model READ model FINAL) | - |
98 | Q_PROPERTY(quint64 internalId READ internalId FINAL) | - |
99 | Q_GADGET | - |
100 | - | |
101 | public: | - |
102 | Q_INVOKABLE QString toString() const | - |
103 | { return QLatin1String("QPersistentModelIndex") + QQmlModelIndexValueType::propertiesString(v); } never executed: return QLatin1String("QPersistentModelIndex") + QQmlModelIndexValueType::propertiesString(v); | 0 |
104 | - | |
105 | inline int row() const { return v.row(); } executed 10 times by 1 test: return v.row(); Executed by:
| 10 |
106 | inline int column() const { return v.column(); } executed 10 times by 1 test: return v.column(); Executed by:
| 10 |
107 | inline QModelIndex parent() const { return v.parent(); } executed 10 times by 1 test: return v.parent(); Executed by:
| 10 |
108 | inline bool isValid() const { return v.isValid(); } executed 10 times by 1 test: return v.isValid(); Executed by:
| 10 |
109 | inline QAbstractItemModel *model() const { return const_cast<QAbstractItemModel *>(v.model()); } executed 10 times by 1 test: return const_cast<QAbstractItemModel *>(v.model()); Executed by:
| 10 |
110 | inline quint64 internalId() const { return v.internalId(); } executed 10 times by 1 test: return v.internalId(); Executed by:
| 10 |
111 | - | |
112 | static const QModelIndex &toModelIndex(const QPersistentModelIndex &index) | - |
113 | { return index; } never executed: return index; | 0 |
114 | }; | - |
115 | - | |
116 | struct QQmlItemSelectionRangeValueType | - |
117 | { | - |
118 | QItemSelectionRange v; | - |
119 | - | |
120 | Q_PROPERTY(int top READ top FINAL) | - |
121 | Q_PROPERTY(int left READ left FINAL) | - |
122 | Q_PROPERTY(int bottom READ bottom FINAL) | - |
123 | Q_PROPERTY(int right READ right FINAL) | - |
124 | Q_PROPERTY(int width READ width FINAL) | - |
125 | Q_PROPERTY(int height READ height FINAL) | - |
126 | Q_PROPERTY(QPersistentModelIndex topLeft READ topLeft FINAL) | - |
127 | Q_PROPERTY(QPersistentModelIndex bottomRight READ bottomRight FINAL) | - |
128 | Q_PROPERTY(QModelIndex parent READ parent FINAL) | - |
129 | Q_PROPERTY(bool valid READ isValid FINAL) | - |
130 | Q_PROPERTY(bool empty READ isEmpty FINAL) | - |
131 | Q_PROPERTY(QAbstractItemModel *model READ model FINAL) | - |
132 | Q_GADGET | - |
133 | - | |
134 | public: | - |
135 | Q_INVOKABLE QString toString() const; | - |
136 | Q_INVOKABLE inline bool contains(const QModelIndex &index) const | - |
137 | { return v.contains(index); } executed 10 times by 1 test: return v.contains(index); Executed by:
| 10 |
138 | Q_INVOKABLE inline bool contains(int row, int column, const QModelIndex &parentIndex) const | - |
139 | { return v.contains(row, column, parentIndex); } executed 2 times by 1 test: return v.contains(row, column, parentIndex); Executed by:
| 2 |
140 | Q_INVOKABLE inline bool intersects(const QItemSelectionRange &other) const | - |
141 | { return v.intersects(other); } executed 2 times by 1 test: return v.intersects(other); Executed by:
| 2 |
142 | Q_INVOKABLE QItemSelectionRange intersected(const QItemSelectionRange &other) const | - |
143 | { return v.intersected(other); } executed 2 times by 1 test: return v.intersected(other); Executed by:
| 2 |
144 | - | |
145 | inline int top() const { return v.top(); } executed 4 times by 1 test: return v.top(); Executed by:
| 4 |
146 | inline int left() const { return v.left(); } executed 4 times by 1 test: return v.left(); Executed by:
| 4 |
147 | inline int bottom() const { return v.bottom(); } executed 4 times by 1 test: return v.bottom(); Executed by:
| 4 |
148 | inline int right() const { return v.right(); } executed 4 times by 1 test: return v.right(); Executed by:
| 4 |
149 | inline int width() const { return v.width(); } executed 4 times by 1 test: return v.width(); Executed by:
| 4 |
150 | inline int height() const { return v.height(); } executed 4 times by 1 test: return v.height(); Executed by:
| 4 |
151 | inline QPersistentModelIndex &topLeft() const { return const_cast<QPersistentModelIndex &>(v.topLeft()); } never executed: return const_cast<QPersistentModelIndex &>(v.topLeft()); | 0 |
152 | inline QPersistentModelIndex &bottomRight() const { return const_cast<QPersistentModelIndex &>(v.bottomRight()); } never executed: return const_cast<QPersistentModelIndex &>(v.bottomRight()); | 0 |
153 | inline QModelIndex parent() const { return v.parent(); } never executed: return v.parent(); | 0 |
154 | inline QAbstractItemModel *model() const { return const_cast<QAbstractItemModel *>(v.model()); } executed 4 times by 1 test: return const_cast<QAbstractItemModel *>(v.model()); Executed by:
| 4 |
155 | inline bool isValid() const { return v.isValid(); } executed 4 times by 1 test: return v.isValid(); Executed by:
| 4 |
156 | inline bool isEmpty() const { return v.isEmpty(); } executed 4 times by 1 test: return v.isEmpty(); Executed by:
| 4 |
157 | }; | - |
158 | - | |
159 | #undef QLISTVALUETYPE_INVOKABLE_API | - |
160 | - | |
161 | QT_END_NAMESPACE | - |
162 | - | |
163 | #endif // QQMLMODELINDEXVALUETYPE_P_H | - |
164 | - | |
Source code | Switch to Preprocessed file |