// Copyright (C) 2016 KlarƤlvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #include #include #include int main() { { //! [0] QString string(QStringLiteral("a string")); QStringIterator i(string); // implicitly converted to QStringView //! [0] //! [1] while (i.hasNext()) uint c = i.next(); //! [1] } { //! [2] QStringIterator i(u"š¯„˛ is the G clef"); qDebug() << Qt::hex << i.next(); // will print 'š¯„˛' (U+1D11E, MUSICAL SYMBOL G CLEF) qDebug() << Qt::hex << i.next(); // will print ' ' (U+0020, SPACE) qDebug() << Qt::hex << i.next(); // will print 'i' (U+0069, LATIN SMALL LETTER I) //! [2] } }