Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
doc_src_qiterator.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
5QList<float> list;
6...
7QListIterator<float> i(list);
8while (i.hasNext())
9 float f = i.next();
11
12
14QListIterator<float> i(list);
15i.toBack();
16while (i.hasPrevious())
17 float f = i.previous();
19
21QSet<QString> set;
22...
23QSetIterator<QString> i(set);
24while (i.hasNext())
25 float f = i.next();
27
29QList<float> list;
30...
31QMutableListIterator<float> i(list);
32while (i.hasNext())
33 float f = i.next();
35
36
38QMutableListIterator<float> i(list);
39i.toBack();
40while (i.hasPrevious())
41 float f = i.previous();
43
44
46QMutableListIterator<int> i(list);
47while (i.hasNext()) {
48 int val = i.next();
49 if (val < 0) {
50 i.setValue(-val);
51 } else if (val == 0) {
52 i.remove();
53 }
54}
56
58QSet<float> set;
59...
60QMutableSetIterator<float> i(set);
61while (i.hasNext())
62 float f = i.next();
64
66QMutableListIterator<int> i(list);
67while (i.hasNext()) {
68 int val = i.next();
69 if (val < -32768 || val > 32767)
70 i.remove();
71}
73
75QMutableSetIterator<int> i(set);
76while (i.hasNext()) {
77 int val = i.next();
78 if (val < -32768 || val > 32767)
79 i.remove();
80}
82
83
85QMutableListIterator<double> i(list);
86while (i.hasNext()) {
87 double val = i.next();
88 i.setValue(std::sqrt(val));
89}
91
93QMap<int, QWidget *> map;
94...
95QMapIterator<int, QWidget *> i(map);
96while (i.hasNext()) {
97 i.next();
98 qDebug() << i.key() << ": " << i.value();
99}
101
102
104QMapIterator<int, QWidget *> i(map);
105i.toBack();
106while (i.hasPrevious()) {
107 i.previous();
108 qDebug() << i.key() << ": " << i.value();
109}
111
112
114QMapIterator<int, QWidget *> i(map);
115while (i.findNext(widget)) {
116 qDebug() << "Found widget " << widget << " under key "
117 << i.key();
118}
120
122QMultiMap<int, QWidget *> multimap;
123...
124QMultiMapIterator<int, QWidget *> i(multimap);
125while (i.hasNext()) {
126 i.next();
127 qDebug() << i.key() << ": " << i.value();
128}
130
131
133QMultiMapIterator<int, QWidget *> i(multimap);
134i.toBack();
135while (i.hasPrevious()) {
136 i.previous();
137 qDebug() << i.key() << ": " << i.value();
138}
140
141
143QMultiMapIterator<int, QWidget *> i(multimap);
144while (i.findNext(widget)) {
145 qDebug() << "Found widget " << widget << " under key "
146 << i.key();
147}
149
150
152QHash<int, QWidget *> hash;
153...
154QHashIterator<int, QWidget *> i(hash);
155while (i.hasNext()) {
156 i.next();
157 qDebug() << i.key() << ": " << i.value();
158}
160
161
163QHashIterator<int, QWidget *> i(hash);
164while (i.findNext(widget)) {
165 qDebug() << "Found widget " << widget << " under key "
166 << i.key();
167}
169
170
172QMap<int, QWidget *> map;
173...
174QMutableMapIterator<int, QWidget *> i(map);
175while (i.hasNext()) {
176 i.next();
177 qDebug() << i.key() << ": " << i.value();
178}
180
181
183QMutableMapIterator<int, QWidget *> i(map);
184i.toBack();
185while (i.hasPrevious()) {
186 i.previous();
187 qDebug() << i.key() << ": " << i.value();
188}
190
191
193QMutableMapIterator<int, QWidget *> i(map);
194while (i.findNext(widget)) {
195 qDebug() << "Found widget " << widget << " under key "
196 << i.key();
197}
199
200
202QMutableMapIterator<QString, QString> i(map);
203while (i.hasNext()) {
204 i.next();
205 if (i.key() == i.value())
206 i.remove();
207}
209
210
212QMultiMap<int, QWidget *> multimap;
213...
214QMutableMultiMapIterator<int, QWidget *> i(multimap);
215while (i.hasNext()) {
216 i.next();
217 qDebug() << i.key() << ": " << i.value();
218}
220
221
223QMutableMultiMapIterator<int, QWidget *> i(multimap);
224i.toBack();
225while (i.hasPrevious()) {
226 i.previous();
227 qDebug() << i.key() << ": " << i.value();
228}
230
231
233QMutableMultiMapIterator<int, QWidget *> i(multimap);
234while (i.findNext(widget)) {
235 qDebug() << "Found widget " << widget << " under key "
236 << i.key();
237}
239
240
242QMutableMultiMapIterator<QString, QString> i(multimap);
243while (i.hasNext()) {
244 i.next();
245 if (i.key() == i.value())
246 i.remove();
247}
249
250
252QHash<int, QWidget *> hash;
253...
254QMutableHashIterator<QString, QWidget *> i(hash);
255while (i.hasNext()) {
256 i.next();
257 qDebug() << i.key() << ": " << i.value();
258}
260
261
263QMutableHashIterator<int, QWidget *> i(hash);
264while (i.findNext(widget)) {
265 qDebug() << "Found widget " << widget << " under key "
266 << i.key();
267}
269
270
272QMutableHashIterator<QString, QString> i(hash);
273while (i.hasNext()) {
274 i.next();
275 if (i.key() == i.value())
276 i.remove();
277}
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
QOpenGLWidget * widget
[1]
QMultiMap< int, QWidget * > multimap
[28]
QSet< QString > set
[1]
QMutableSetIterator< float > i(set)
[19]
QMap< int, QWidget * > map
[23]
QList< float > list
[0]
QHash< int, QWidget * > hash
[28multi]
#define qDebug
[1]
Definition qlogging.h:164
GLfloat GLfloat f
GLuint GLfloat * val