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
textdocumentendsnippet.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
4#include <QtGui>
5#include <iostream>
6
8void wrapper()
9{
10 QString contentString("One\nTwp\nThree");
11 QTextDocument *doc = new QTextDocument(contentString);
12
14for (QTextBlock it = doc->begin(); it != doc->end(); it = it.next())
15 std::cout << it.text().toStdString() << "\n";
17
18} // wrapper
19} //textdocumentendsnippet
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\reentrant
\reentrant \inmodule QtGui
QTextBlock begin() const
Returns the document's first text block.
QTextBlock end() const
This function returns a block to test for the end of the document while iterating over it.
QSet< QString >::iterator it