Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
src_corelib_text_qstringiterator.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 KlarƤlvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4
#
include
<
QString
>
5
#
include
<
QStringIterator
>
6
#
include
<
QDebug
>
7
8
int
main
()
9
{
10
11
{
12
//! [0]
13
QString string(QStringLiteral(
"a string"
));
14
QStringIterator i(string);
// implicitly converted to QStringView
15
//! [0]
16
17
//! [1]
18
while
(i.hasNext())
19
char32_t
c = i.next();
20
//! [1]
21
}
22
23
{
24
//! [2]
25
QStringIterator i(u"𝄞 is the G clef");
26
qDebug() << Qt::hex << i.next();
// will print '𝄞' (U+1D11E, MUSICAL SYMBOL G CLEF)
27
qDebug() << Qt::hex << i.next();
// will print ' ' (U+0020, SPACE)
28
qDebug() << Qt::hex << i.next();
// will print 'i' (U+0069, LATIN SMALL LETTER I)
29
//! [2]
30
}
31
32
}
main
int main()
[open]
Definition
doc_src_objecttrees.cpp:7
qtbase
src
corelib
doc
snippets
code
src_corelib_text_qstringiterator.cpp
Generated on
for Qt by
1.14.0