summaryrefslogtreecommitdiffstats
path: root/src/xml/dom
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2022-06-30 13:34:44 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2022-08-17 17:02:27 +0200
commite684c25b859cfa1cf2cd93c8c9be374ee6f6a289 (patch)
treec60bd09d83a32f446473032069ca731052ee54eb /src/xml/dom
parent2f7a78cd7b3351bc7a1a209d0822769d111f246b (diff)
QDomDocument: deprecate old setContent() overloads in favor of new ones
And use the new overloads in examples and tests. [ChangeLog][QtXml][QDomDocument] Deprecated the old setContent() overloads in favor of the new ones that take ParseOptions and ParseError. Task-number: QTBUG-104507 Change-Id: I61b37eba2fe3002c03bddc90f6877676d539f7ec Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/xml/dom')
-rw-r--r--src/xml/dom/qdom.cpp14
-rw-r--r--src/xml/dom/qdom.h9
2 files changed, 22 insertions, 1 deletions
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index b2fcac7f1b..d02f3be7ec 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -6031,8 +6031,12 @@ QDomDocument::~QDomDocument()
{
}
+#if QT_DEPRECATED_SINCE(6, 8)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
/*!
\overload
+ \deprecated [6.8] Use the overloads taking ParseOptions instead.
This function reads the XML document from the string \a text, returning
true if the content was successfully parsed; otherwise returns \c false.
@@ -6048,6 +6052,8 @@ bool QDomDocument::setContent(const QString& text, bool namespaceProcessing,
}
/*!
+ \deprecated [6.8] Use the overload taking ParseOptions instead.
+
This function parses the XML document from the byte array \a
data and sets it as the content of the document. It tries to
detect the encoding of the document as required by the XML
@@ -6125,6 +6131,7 @@ static inline void unpackParseResult(const QDomDocument::ParseResult &parseResul
/*!
\overload
+ \deprecated [6.8] Use the overload taking ParseOptions instead.
This function reads the XML document from the IO device \a dev, returning
true if the content was successfully parsed; otherwise returns \c false.
@@ -6144,6 +6151,7 @@ bool QDomDocument::setContent(QIODevice* dev, bool namespaceProcessing,
/*!
\overload
+ \deprecated [6.8] Use the overload returning ParseResult instead.
This function reads the XML document from the string \a text, returning
true if the content was successfully parsed; otherwise returns \c false.
@@ -6159,6 +6167,7 @@ bool QDomDocument::setContent(const QString& text, QString *errorMsg, int *error
/*!
\overload
+ \deprecated [6.8] Use the overload returning ParseResult instead.
This function reads the XML document from the byte array \a buffer,
returning true if the content was successfully parsed; otherwise returns
@@ -6173,7 +6182,7 @@ bool QDomDocument::setContent(const QByteArray& buffer, QString *errorMsg, int *
/*!
\overload
- \deprecated
+ \deprecated [6.8] Use the overload returning ParseResult instead.
This function reads the XML document from the IO device \a dev, returning
true if the content was successfully parsed; otherwise returns \c false.
@@ -6188,6 +6197,7 @@ bool QDomDocument::setContent(QIODevice* dev, QString *errorMsg, int *errorLine,
/*!
\overload
\since 5.15
+ \deprecated [6.8] Use the overload taking ParseOptions instead.
This function reads the XML document from the QXmlStreamReader \a reader
and parses it. Returns \c true if the content was successfully parsed;
@@ -6211,6 +6221,8 @@ bool QDomDocument::setContent(QXmlStreamReader *reader, bool namespaceProcessing
unpackParseResult(result, errorMsg, errorLine, errorColumn);
return bool(result);
}
+QT_WARNING_POP
+#endif // QT_DEPRECATED_SINCE(6, 8)
/*!
\enum QDomDocument::ParseOption
diff --git a/src/xml/dom/qdom.h b/src/xml/dom/qdom.h
index 390a319553..7333b60774 100644
--- a/src/xml/dom/qdom.h
+++ b/src/xml/dom/qdom.h
@@ -313,14 +313,23 @@ public:
inline QDomNode::NodeType nodeType() const { return DocumentNode; }
// Qt extensions
+#if QT_DEPRECATED_SINCE(6, 8)
+ QT_DEPRECATED_VERSION_X_6_8("Use the overload taking ParseOptions instead.")
bool setContent(const QByteArray &text, bool namespaceProcessing, QString *errorMsg = nullptr, int *errorLine = nullptr, int *errorColumn = nullptr);
+ QT_DEPRECATED_VERSION_X_6_8("Use the overload taking ParseOptions instead.")
bool setContent(const QString &text, bool namespaceProcessing, QString *errorMsg = nullptr, int *errorLine = nullptr, int *errorColumn = nullptr);
+ QT_DEPRECATED_VERSION_X_6_8("Use the overload taking ParseOptions instead.")
bool setContent(QIODevice *dev, bool namespaceProcessing, QString *errorMsg = nullptr, int *errorLine = nullptr, int *errorColumn = nullptr);
+ QT_DEPRECATED_VERSION_X_6_8("Use the overload returning ParseResult instead.")
bool setContent(const QByteArray &text, QString *errorMsg, int *errorLine = nullptr, int *errorColumn = nullptr);
+ QT_DEPRECATED_VERSION_X_6_8("Use the overload returning ParseResult instead.")
bool setContent(const QString &text, QString *errorMsg, int *errorLine = nullptr, int *errorColumn = nullptr);
+ QT_DEPRECATED_VERSION_X_6_8("Use the overload returning ParseResult instead.")
bool setContent(QIODevice *dev, QString *errorMsg, int *errorLine = nullptr, int *errorColumn = nullptr);
+ QT_DEPRECATED_VERSION_X_6_8("Use the overload taking ParseOptions instead.")
bool setContent(QXmlStreamReader *reader, bool namespaceProcessing, QString *errorMsg = nullptr,
int *errorLine = nullptr, int *errorColumn = nullptr);
+#endif // QT_DEPRECATED_SINCE(6, 8)
Q_WEAK_OVERLOAD
ParseResult setContent(const QByteArray &data, ParseOptions options = ParseOption::Default)