Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
src_xml_dom_qdom_snippet.cpp
Go to the documentation of this file.
1
// Copyright (C) 2020 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
//! [4]
4
<body>
5
<h1>Heading</h1>
6
<p>Hello <b>you</b></p>
7
</body>
8
//! [4]
9
10
//! [5]
11
<h1>Heading</h1>
12
<p>The text...</p>
13
<h2>Next heading</h2>
14
//! [5]
15
16
//! [6]
17
<h1>Heading</h1>
18
<p>The text...</p>
19
<h2>Next heading</h2>
20
//! [6]
21
22
//! [7]
23
<link href=
"http://qt-project.org"
color=
"red"
/>
24
//! [7]
25
26
//! [9]
27
QDomElement e =
//...
28
//...
29
QString s = e.text()
30
//! [9]
31
32
//! [11]
33
QDomDocument doc =
// ...
34
QDomElement root = doc.firstChildElement(
"database"
);
35
QDomElement elt = root.firstChildElement(
"entry"
);
36
for
(; !elt.isNull(); elt = elt.nextSiblingElement(
"entry"
)) {
37
// ...
38
}
39
//! [11]
40
41
//! [12]
42
<img src=
"myimg.png"
>
43
//! [12]
44
45
//! [13]
46
<h1>Hello <b>Qt</b> <![CDATA[<xml is cool>]]></h1>
47
//! [13]
48
49
//! [14]
50
Hello Qt <xml is cool>
51
//! [14]
52
53
//! [15]
54
<!--
this
is a comment -->
55
//! [15]
qtbase
src
xml
doc
snippets
code
src_xml_dom_qdom_snippet.cpp
Generated on
for Qt by
1.18.0