Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qqmlmodelindexvaluetype_p.h
Go to the documentation of this file.
1
// Copyright (C) 2021 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant
4
5
#
ifndef
QQMLMODELINDEXVALUETYPE_P_H
6
#
define
QQMLMODELINDEXVALUETYPE_P_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists purely as an
13
// implementation detail. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
<
QtCore
/
qabstractitemmodel
.
h
>
20
#
include
<
QtCore
/
qitemselectionmodel
.
h
>
21
#
include
<
QtQml
/
qqml
.
h
>
22
#
include
<
QtCore
/
private
/
qglobal_p
.
h
>
23
24
QT_BEGIN_NAMESPACE
25
26
struct
QQmlModelIndexValueType
27
{
28
QModelIndex v;
29
30
Q_PROPERTY(
int
row READ row CONSTANT FINAL)
31
Q_PROPERTY(
int
column READ column CONSTANT FINAL)
32
Q_PROPERTY(QModelIndex parent READ parent FINAL)
33
Q_PROPERTY(
bool
valid READ isValid CONSTANT FINAL)
34
Q_PROPERTY(QAbstractItemModel *model READ model CONSTANT FINAL)
35
Q_PROPERTY(quint64 internalId READ internalId CONSTANT FINAL)
36
Q_GADGET
37
QML_ANONYMOUS
38
QML_EXTENDED(QQmlModelIndexValueType)
39
QML_FOREIGN(QModelIndex)
40
QML_ADDED_IN_VERSION(2, 0)
41
42
public
:
43
Q_INVOKABLE QString toString()
const
44
{
return
QLatin1String(
"QModelIndex"
) + propertiesString(v); }
45
46
Q_REVISION(6, 7) Q_INVOKABLE QVariant data(
int
role = Qt::DisplayRole)
const
47
{
return
v.data(role); }
48
49
inline
int
row()
const
noexcept
{
return
v.row(); }
50
inline
int
column()
const
noexcept
{
return
v.column(); }
51
inline
QModelIndex parent()
const
{
return
v.parent(); }
52
inline
bool
isValid()
const
noexcept
{
return
v.isValid(); }
53
inline
QAbstractItemModel *model()
const
noexcept
54
{
return
const_cast
<QAbstractItemModel *>(v.model()); }
55
quint64 internalId()
const
{
return
v.internalId(); }
56
57
static
QString propertiesString(
const
QModelIndex &idx);
58
59
static
QPersistentModelIndex toPersistentModelIndex(
const
QModelIndex &index)
60
{
return
QPersistentModelIndex(index); }
61
62
operator QModelIndex()
const
{
return
v; }
63
};
64
65
struct
QQmlPersistentModelIndexValueType
66
{
67
QPersistentModelIndex
v
;
68
69
Q_PROPERTY(
int
row READ row FINAL)
70
Q_PROPERTY
(
int
column
READ
column
FINAL
)
71
Q_PROPERTY
(
QModelIndex
parent
READ
parent
FINAL
)
72
Q_PROPERTY
(
bool
valid
READ
isValid
FINAL
)
73
Q_PROPERTY
(
QAbstractItemModel
*
model
READ
model
FINAL
)
74
Q_PROPERTY
(
quint64
internalId
READ
internalId
FINAL
)
75
Q_GADGET
76
QML_ANONYMOUS
77
QML_EXTENDED
(
QQmlPersistentModelIndexValueType
)
78
QML_FOREIGN
(
QPersistentModelIndex
)
79
QML_ADDED_IN_VERSION
(2, 0)
80
81
public
:
82
Q_INVOKABLE
QString
toString
()
const
83
{
return
QLatin1String
(
"QPersistentModelIndex"
) +
QQmlModelIndexValueType
::
propertiesString
(
v
); }
84
85
Q_REVISION
(6, 7)
Q_INVOKABLE
QVariant
data
(
int
role
=
Qt
::
DisplayRole
)
const
86
{
return
v
.
data
(
role
); }
87
88
inline
int
row
()
const
{
return
v
.
row
(); }
89
inline
int
column
()
const
{
return
v
.
column
(); }
90
inline
QModelIndex
parent
()
const
{
return
v
.
parent
(); }
91
inline
bool
isValid
()
const
{
return
v
.
isValid
(); }
92
inline
QAbstractItemModel
*
model
()
const
{
return
const_cast
<
QAbstractItemModel
*>(
v
.
model
()); }
93
inline
quint64
internalId
()
const
{
return
v
.
internalId
(); }
94
95
operator
QPersistentModelIndex
()
const
{
return
v
; }
96
};
97
98
struct
QQmlItemSelectionRangeValueType
99
{
100
QItemSelectionRange
v
;
101
102
Q_PROPERTY(
int
top READ top FINAL)
103
Q_PROPERTY
(
int
left
READ
left
FINAL
)
104
Q_PROPERTY
(
int
bottom
READ
bottom
FINAL
)
105
Q_PROPERTY
(
int
right
READ
right
FINAL
)
106
Q_PROPERTY
(
int
width
READ
width
FINAL
)
107
Q_PROPERTY
(
int
height
READ
height
FINAL
)
108
Q_PROPERTY
(
QPersistentModelIndex
topLeft
READ
topLeft
FINAL
)
109
Q_PROPERTY
(
QPersistentModelIndex
bottomRight
READ
bottomRight
FINAL
)
110
Q_PROPERTY
(
QModelIndex
parent
READ
parent
FINAL
)
111
Q_PROPERTY
(
bool
valid
READ
isValid
FINAL
)
112
Q_PROPERTY
(
bool
empty
READ
isEmpty
FINAL
)
113
Q_PROPERTY
(
QAbstractItemModel
*
model
READ
model
FINAL
)
114
Q_GADGET
115
QML_ANONYMOUS
116
QML_EXTENDED
(
QQmlItemSelectionRangeValueType
)
117
QML_FOREIGN
(
QItemSelectionRange
)
118
QML_ADDED_IN_VERSION
(2, 0)
119
120
public
:
121
Q_INVOKABLE
QString
toString
()
const
;
122
Q_INVOKABLE
inline
bool
contains
(
const
QModelIndex &index)
const
123
{
return
v.contains(index); }
124
Q_INVOKABLE
inline
bool
contains
(
int
row,
int
column,
const
QModelIndex &parentIndex)
const
125
{
return
v.contains(row, column, parentIndex); }
126
Q_INVOKABLE
inline
bool
intersects
(
const
QItemSelectionRange &other)
const
127
{
return
v.intersects(other); }
128
Q_INVOKABLE QItemSelectionRange
intersected
(
const
QItemSelectionRange
&
other
)
const
129
{
return
v
.
intersected
(
other
); }
130
131
inline
int
top
()
const
{
return
v
.
top
(); }
132
inline
int
left
()
const
{
return
v
.
left
(); }
133
inline
int
bottom
()
const
{
return
v
.
bottom
(); }
134
inline
int
right
()
const
{
return
v
.
right
(); }
135
inline
int
width
()
const
{
return
v
.
width
(); }
136
inline
int
height
()
const
{
return
v
.
height
(); }
137
inline
QPersistentModelIndex
&
topLeft
()
const
{
return
const_cast
<
QPersistentModelIndex
&>(
v
.
topLeft
()); }
138
inline
QPersistentModelIndex
&
bottomRight
()
const
{
return
const_cast
<
QPersistentModelIndex
&>(
v
.
bottomRight
()); }
139
inline
QModelIndex
parent
()
const
{
return
v
.
parent
(); }
140
inline
QAbstractItemModel
*
model
()
const
{
return
const_cast
<
QAbstractItemModel
*>(
v
.
model
()); }
141
inline
bool
isValid
()
const
{
return
v
.
isValid
(); }
142
inline
bool
isEmpty
()
const
{
return
v
.
isEmpty
(); }
143
144
operator
QItemSelectionRange
()
const
{
return
v
; }
145
};
146
147
struct
QModelIndexListForeign
148
{
149
Q_GADGET
150
QML_ANONYMOUS
151
QML_SEQUENTIAL_CONTAINER
(
QModelIndex
)
152
QML_FOREIGN
(
QModelIndexList
)
153
QML_ADDED_IN_VERSION
(2, 0)
154
};
155
156
struct
QModelIndexStdVectorForeign
157
{
158
Q_GADGET
159
QML_ANONYMOUS
160
QML_SEQUENTIAL_CONTAINER
(
QModelIndex
)
161
QML_FOREIGN
(
std
::
vector
<
QModelIndex
>)
162
QML_ADDED_IN_VERSION
(2, 0)
163
};
164
165
struct
QItemSelectionForeign
166
{
167
Q_GADGET
168
QML_ANONYMOUS
169
QML_SEQUENTIAL_CONTAINER
(
QItemSelectionRange
)
170
QML_FOREIGN
(
QItemSelection
)
171
QML_ADDED_IN_VERSION
(2, 0)
172
};
173
174
#
undef
QLISTVALUETYPE_INVOKABLE_API
175
176
QT_END_NAMESPACE
177
178
#
endif
// QQMLMODELINDEXVALUETYPE_P_H
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QItemSelectionForeign
Definition
qqmlmodelindexvaluetype_p.h:166
QModelIndexListForeign
Definition
qqmlmodelindexvaluetype_p.h:148
QModelIndexStdVectorForeign
Definition
qqmlmodelindexvaluetype_p.h:157
QQmlItemSelectionRangeValueType
Definition
qqmlmodelindexvaluetype_p.h:99
QQmlItemSelectionRangeValueType::contains
Q_INVOKABLE bool contains(int row, int column, const QModelIndex &parentIndex) const
Definition
qqmlmodelindexvaluetype_p.h:124
QQmlItemSelectionRangeValueType::v
QItemSelectionRange v
Definition
qqmlmodelindexvaluetype_p.h:100
QQmlItemSelectionRangeValueType::contains
Q_INVOKABLE bool contains(const QModelIndex &index) const
Definition
qqmlmodelindexvaluetype_p.h:122
QQmlItemSelectionRangeValueType::intersects
Q_INVOKABLE bool intersects(const QItemSelectionRange &other) const
Definition
qqmlmodelindexvaluetype_p.h:126
QQmlPersistentModelIndexValueType
Definition
qqmlmodelindexvaluetype_p.h:66
QQmlPersistentModelIndexValueType::v
QPersistentModelIndex v
Definition
qqmlmodelindexvaluetype_p.h:67
qtdeclarative
src
qmlmodels
qqmlmodelindexvaluetype_p.h
Generated on
for Qt by
1.18.0