Qt
6.x
The Qt SDK
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
7
namespace
textdocumentendsnippet
{
8
void
wrapper
()
9
{
10
QString
contentString(
"One\nTwp\nThree"
);
11
QTextDocument
*doc =
new
QTextDocument
(contentString);
12
14
for
(
QTextBlock
it
= doc->
begin
();
it
!= doc->
end
();
it
=
it
.next())
15
std::cout <<
it
.text().toStdString() <<
"\n"
;
17
18
}
// wrapper
19
}
//textdocumentendsnippet
QString
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition
qstring.h:127
QTextBlock
\reentrant
Definition
qtextobject.h:157
QTextDocument
\reentrant \inmodule QtGui
Definition
qtextdocument.h:57
QTextDocument::begin
QTextBlock begin() const
Returns the document's first text block.
Definition
qtextdocument.cpp:1651
QTextDocument::end
QTextBlock end() const
This function returns a block to test for the end of the document while iterating over it.
Definition
qtextdocument.cpp:1669
it
QSet< QString >::iterator it
Definition
doc_src_qset.cpp:85
textdocumentendsnippet
Definition
textdocumentendsnippet.cpp:7
textdocumentendsnippet::wrapper
void wrapper()
Definition
textdocumentendsnippet.cpp:8
qtbase
src
gui
doc
snippets
textdocument-end
textdocumentendsnippet.cpp
Generated by
1.9.7