summaryrefslogtreecommitdiffstats
path: root/src/xml/doc/src
diff options
context:
space:
mode:
Diffstat (limited to 'src/xml/doc/src')
-rw-r--r--src/xml/doc/src/dontdocument.qdoc28
-rw-r--r--src/xml/doc/src/external-resources.qdoc28
-rw-r--r--src/xml/doc/src/qt6-changes.qdoc49
-rw-r--r--src/xml/doc/src/qtxml-index.qdoc34
-rw-r--r--src/xml/doc/src/qtxml.qdoc30
-rw-r--r--src/xml/doc/src/xml-processing.qdoc74
6 files changed, 50 insertions, 193 deletions
diff --git a/src/xml/doc/src/dontdocument.qdoc b/src/xml/doc/src/dontdocument.qdoc
index 0193ace4b4..3601a9841a 100644
--- a/src/xml/doc/src/dontdocument.qdoc
+++ b/src/xml/doc/src/dontdocument.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\dontdocument (QTypeInfo)
diff --git a/src/xml/doc/src/external-resources.qdoc b/src/xml/doc/src/external-resources.qdoc
index 092e4f80b3..89c30a84c4 100644
--- a/src/xml/doc/src/external-resources.qdoc
+++ b/src/xml/doc/src/external-resources.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
diff --git a/src/xml/doc/src/qt6-changes.qdoc b/src/xml/doc/src/qt6-changes.qdoc
index 7a19649fb2..f3ff82130a 100644
--- a/src/xml/doc/src/qt6-changes.qdoc
+++ b/src/xml/doc/src/qt6-changes.qdoc
@@ -1,35 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page xml-changes-qt6.html
\title Changes to Qt XML
\ingroup changes-qt-5-to-6
- \brief Migrate Qt XML to Qt 6.
+ \brief Use QXmlStreamReader for reading XML files.
Qt 6 is a result of the conscious effort to make the framework more
efficient and easy to use.
@@ -46,7 +22,9 @@
QXmlStreamReader for reading XML files. Here are some simple steps to
port your current code to QXmlStreamReader:
- \oldcode
+ For example, if you have code like
+
+ \code
QFile *file = new QFile(...);
QXmlInputSource *source = new QXmlInputSource(file);
@@ -61,7 +39,11 @@
} else {
... // do error handling
}
- \newcode
+ \endcode
+
+ you can rewrite it as
+
+ \code
QFile file = ...;
QXmlStreamReader reader(&file);
@@ -91,6 +73,15 @@
If you use QDomDocument and rely on any of these, you must update
your code and XML documents accordingly.
+ \section3 Spacing-only text nodes
+
+ By default, text nodes containing only spacing characters are stripped
+ and won't appear in the QDomDocument. The Qt 5 way of changing this behavior
+ was using the QDomDocument::setContent() overload that allowed a \c QXmlReader
+ to be supplied. That overload was removed in Qt 6.0, but since Qt 6.5,
+ you can pass QDomDocument::ParseOption::PreserveSpacingOnlyNodes as a parse
+ option, to specify that spacing-only text nodes must be preserved.
+
\section2 Qt Core5 compatibility library
If your application or library cannot be ported right now, the \l
diff --git a/src/xml/doc/src/qtxml-index.qdoc b/src/xml/doc/src/qtxml-index.qdoc
index 79d0ae4e09..7ad55350a5 100644
--- a/src/xml/doc/src/qtxml-index.qdoc
+++ b/src/xml/doc/src/qtxml-index.qdoc
@@ -1,38 +1,12 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page qtxml-index.html
\title Qt XML
- \brief The Qt XML module provides C++ implementations of the SAX and DOM standards for XML.
+ \brief The Qt XML module provides a C++ implementation of the DOM standard for XML.
-
- The Qt XML module provides implementations of the SAX and DOM standards for
- XML.
+ The Qt XML module provides an implementation of the DOM standard for XML.
\note Qt XML will no longer receive additional features. For reading or
writing XML documents iteratively (SAX), use the QXmlStreamReader and
diff --git a/src/xml/doc/src/qtxml.qdoc b/src/xml/doc/src/qtxml.qdoc
index 179244bc44..76394392be 100644
--- a/src/xml/doc/src/qtxml.qdoc
+++ b/src/xml/doc/src/qtxml.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\module QtXml
@@ -32,7 +8,7 @@
\qtcmakepackage Xml
\qtvariable xml
- \brief The Qt XML module provides C++ implementations of the SAX and DOM standards for XML.
+ \brief The Qt XML module provides a C++ implementation of the DOM standard for XML.
The \l{Qt XML} page contains information about how to use the module.
diff --git a/src/xml/doc/src/xml-processing.qdoc b/src/xml/doc/src/xml-processing.qdoc
index 226eeb196d..acca1b070b 100644
--- a/src/xml/doc/src/xml-processing.qdoc
+++ b/src/xml/doc/src/xml-processing.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\group xml-tools
@@ -31,7 +7,7 @@
\brief Classes that support XML.
- These classes are relevant to XML users.
+ These classes are relevant to \l{XML Processing}{XML} users.
\generatelist{related}
*/
@@ -39,6 +15,7 @@
/*!
\page xml-processing.html
\title XML Processing
+ \ingroup explanations-dataprocessingandio
\brief An Overview of the XML processing facilities in Qt.
@@ -204,7 +181,7 @@
namespace prefix. In this case the local part and the qualified name
are identical (i.e. \e chapter).
- \sa {DOM Bookmarks Example}
+ \sa {DOM Bookmarks Application}
*/
/*!
@@ -215,7 +192,8 @@
\nextpage Working with the DOM Tree
Qt provides two classes for reading and writing XML through a simple streaming
- API: QXmlStreamReader and QXmlStreamWriter.
+ API: QXmlStreamReader and QXmlStreamWriter. These classes are located in
+ \l{Qt Serialization}{Qt Serialization (part of QtCore)}.
A stream reader reports an XML document as a stream
of tokens. This differs from SAX as SAX applications provide handlers to
@@ -231,27 +209,14 @@
\l{QXmlStreamReader::error()}{error()} and \l{QXmlStreamReader::hasError()}
{hasError()} can be used to check and view the errors.
- An example of QXmlStreamReader implementation would be the \c XbelReader in
- \l{QXmlStream Bookmarks Example}, which wraps a QXmlStreamReader.
- The constructor takes \a treeWidget as a parameter and the class has Xbel
- specific functions:
-
- \snippet streambookmarks/xbelreader.h 1
-
- \dots
- \snippet streambookmarks/xbelreader.h 2
- \dots
+ An example of an implementation tha uses QXmlStreamReader would be the
+ \l{QXmlStream Bookmarks Example#xbelreader-class-definition}{XbelReader} in
+ \l{QXmlStream Bookmarks Example}, which wraps a QXmlStreamReader. Read the
+ \l{QXmlStream Bookmarks Example#xbelreader-class-implementation}{implementation}
+ to learn more about how to use the QXmlStreamReader class.
- The \c read() function accepts a QIODevice and sets it with
- \l{QXmlStreamReader::setDevice()}{setDevice()}. The
- \l{QXmlStreamReader::raiseError()}{raiseError()} function is used to
- display a custom error message, inidicating that the file's version
- is incorrect.
-
- \snippet streambookmarks/xbelreader.cpp 1
-
- The pendent to QXmlStreamReader is QXmlStreamWriter, which provides an XML
- writer with a simple streaming API. QXmlStreamWriter operates on a
+ Paired with QXmlStreamReader is the QXmlStreamWriter class, which provides
+ an XML writer with a simple streaming API. QXmlStreamWriter operates on a
QIODevice and has specialized functions for all XML tokens or events you
want to write, such as \l{QXmlStreamWriter::writeDTD()}{writeDTD()},
\l{QXmlStreamWriter::writeCharacters()}{writeCharacters()},
@@ -277,11 +242,10 @@
or subsequent calls to \l{QXmlStreamWriter::writeStartElement()}
{writeStartElement()}.
- The \c XbelWriter class from \l{QXmlStream Bookmarks Example} wraps a
- QXmlStreamWriter. Its \c writeFile() function illustrates the core
- functions of QXmlStreamWriter mentioned above:
-
- \snippet streambookmarks/xbelwriter.cpp 1
+ The \l{QXmlStream Bookmarks Example#xbelwriter-class-definition}{XbelWriter}
+ class from \l{QXmlStream Bookmarks Example} wraps a QXmlStreamWriter. View
+ the \l{QXmlStream Bookmarks Example#xbelwriter-class-implementation}{implementation}
+ to see how to use the QXmlStreamWriter class.
*/
/*!
@@ -376,7 +340,7 @@
DOM implementation.
To get started please refer to the \l QDomDocument documentation.
- You might also want to take a look at the \l{DOM Bookmarks Example},
+ You might also want to take a look at the \l{DOM Bookmarks Application},
which illustrates how to read and write an XML bookmark file (XBEL)
using DOM.
*/