summaryrefslogtreecommitdiffstats
path: root/src/xml/dom
diff options
context:
space:
mode:
Diffstat (limited to 'src/xml/dom')
-rw-r--r--src/xml/dom/qdom.cpp37
-rw-r--r--src/xml/dom/qdom.h12
-rw-r--r--src/xml/dom/qdom_p.h5
-rw-r--r--src/xml/dom/qdomhelpers.cpp22
-rw-r--r--src/xml/dom/qdomhelpers_p.h23
5 files changed, 95 insertions, 4 deletions
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index cb753ed573..bbc877eead 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -5691,6 +5691,10 @@ void QDomDocumentPrivate::clear()
QDomNodePrivate::clear();
}
+#if QT_DEPRECATED_SINCE(5, 15)
+
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
static void initializeReader(QXmlSimpleReader &reader, bool namespaceProcessing)
{
reader.setFeature(QLatin1String("http://xml.org/sax/features/namespaces"), namespaceProcessing);
@@ -5734,6 +5738,9 @@ bool QDomDocumentPrivate::setContent(QXmlInputSource *source, QXmlReader *reader
return true;
}
+QT_WARNING_POP
+
+#endif // QT_DEPRECATED_SINCE(5, 15)
bool QDomDocumentPrivate::setContent(QXmlStreamReader *reader, bool namespaceProcessing,
QString *errorMsg, int *errorLine, int *errorColumn)
@@ -6183,8 +6190,11 @@ bool QDomDocument::setContent(const QString& text, bool namespaceProcessing, QSt
if (!impl)
impl = new QDomDocumentPrivate();
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_DEPRECATED_SINCE(5, 15)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
QXmlInputSource source;
+QT_WARNING_POP
source.setData(text);
return IMPL->setContent(&source, namespaceProcessing, errorMsg, errorLine, errorColumn);
#else
@@ -6252,10 +6262,13 @@ bool QDomDocument::setContent(const QByteArray &data, bool namespaceProcessing,
if (!impl)
impl = new QDomDocumentPrivate();
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_DEPRECATED_SINCE(5, 15)
QBuffer buf;
buf.setData(data);
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
QXmlInputSource source(&buf);
+QT_WARNING_POP
return IMPL->setContent(&source, namespaceProcessing, errorMsg, errorLine, errorColumn);
#else
QXmlStreamReader streamReader(data);
@@ -6275,8 +6288,11 @@ bool QDomDocument::setContent(QIODevice* dev, bool namespaceProcessing, QString
if (!impl)
impl = new QDomDocumentPrivate();
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_DEPRECATED_SINCE(5, 15)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
QXmlInputSource source(dev);
+QT_WARNING_POP
return IMPL->setContent(&source, namespaceProcessing, errorMsg, errorLine, errorColumn);
#else
QXmlStreamReader streamReader(dev);
@@ -6285,14 +6301,18 @@ bool QDomDocument::setContent(QIODevice* dev, bool namespaceProcessing, QString
#endif
}
+#if QT_DEPRECATED_SINCE(5, 15)
/*!
\overload
+ \obsolete
\since 4.5
This function reads the XML document from the QXmlInputSource \a source,
returning true if the content was successfully parsed; otherwise returns \c false.
*/
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
bool QDomDocument::setContent(QXmlInputSource *source, bool namespaceProcessing, QString *errorMsg, int *errorLine, int *errorColumn )
{
if (!impl)
@@ -6301,6 +6321,9 @@ bool QDomDocument::setContent(QXmlInputSource *source, bool namespaceProcessing,
initializeReader(reader, namespaceProcessing);
return IMPL->setContent(source, &reader, &reader, errorMsg, errorLine, errorColumn);
}
+QT_WARNING_POP
+
+#endif
/*!
\overload
@@ -6333,6 +6356,7 @@ bool QDomDocument::setContent(const QByteArray& buffer, QString *errorMsg, int *
/*!
\overload
+ \obsolete
This function reads the XML document from the IO device \a dev, returning
true if the content was successfully parsed; otherwise returns \c false.
@@ -6344,8 +6368,10 @@ bool QDomDocument::setContent(QIODevice* dev, QString *errorMsg, int *errorLine,
return setContent(dev, false, errorMsg, errorLine, errorColumn);
}
+#if QT_DEPRECATED_SINCE(5, 15)
/*!
\overload
+ \obsolete
This function reads the XML document from the QXmlInputSource \a source and
parses it with the QXmlReader \a reader, returning true if the content was
@@ -6357,12 +6383,17 @@ bool QDomDocument::setContent(QIODevice* dev, QString *errorMsg, int *errorLine,
\sa QXmlSimpleReader
*/
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
bool QDomDocument::setContent(QXmlInputSource *source, QXmlReader *reader, QString *errorMsg, int *errorLine, int *errorColumn )
{
if (!impl)
impl = new QDomDocumentPrivate();
return IMPL->setContent(source, reader, nullptr, errorMsg, errorLine, errorColumn);
}
+QT_WARNING_POP
+
+#endif
/*!
\overload
diff --git a/src/xml/dom/qdom.h b/src/xml/dom/qdom.h
index 1b00a14179..d50c5e8394 100644
--- a/src/xml/dom/qdom.h
+++ b/src/xml/dom/qdom.h
@@ -339,11 +339,23 @@ public:
bool setContent(const QByteArray& text, bool namespaceProcessing, QString *errorMsg=nullptr, int *errorLine=nullptr, int *errorColumn=nullptr );
bool setContent(const QString& text, bool namespaceProcessing, QString *errorMsg=nullptr, int *errorLine=nullptr, int *errorColumn=nullptr );
bool setContent(QIODevice* dev, bool namespaceProcessing, QString *errorMsg=nullptr, int *errorLine=nullptr, int *errorColumn=nullptr );
+#if QT_DEPRECATED_SINCE(5, 15)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
+ QT_DEPRECATED_X("Use other overloads instead")
bool setContent(QXmlInputSource *source, bool namespaceProcessing, QString *errorMsg=nullptr, int *errorLine=nullptr, int *errorColumn=nullptr );
+QT_WARNING_POP
+#endif
bool setContent(const QByteArray& text, QString *errorMsg=nullptr, int *errorLine=nullptr, int *errorColumn=nullptr );
bool setContent(const QString& text, QString *errorMsg=nullptr, int *errorLine=nullptr, int *errorColumn=nullptr );
bool setContent(QIODevice* dev, QString *errorMsg=nullptr, int *errorLine=nullptr, int *errorColumn=nullptr );
+#if QT_DEPRECATED_SINCE(5, 15)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
+ QT_DEPRECATED_X("Use other overloads instead")
bool setContent(QXmlInputSource *source, QXmlReader *reader, QString *errorMsg=nullptr, int *errorLine=nullptr, int *errorColumn=nullptr );
+QT_WARNING_POP
+#endif
bool setContent(QXmlStreamReader *reader, bool namespaceProcessing, QString *errorMsg = nullptr,
int *errorLine = nullptr, int *errorColumn = nullptr);
diff --git a/src/xml/dom/qdom_p.h b/src/xml/dom/qdom_p.h
index b66c756af0..a9399d9901 100644
--- a/src/xml/dom/qdom_p.h
+++ b/src/xml/dom/qdom_p.h
@@ -461,10 +461,15 @@ public:
QDomDocumentPrivate(QDomDocumentPrivate *n, bool deep);
~QDomDocumentPrivate();
+#if QT_DEPRECATED_SINCE(5, 15)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
bool setContent(QXmlInputSource *source, bool namespaceProcessing, QString *errorMsg,
int *errorLine, int *errorColumn);
bool setContent(QXmlInputSource *source, QXmlReader *reader, QXmlSimpleReader *simpleReader,
QString *errorMsg, int *errorLine, int *errorColumn);
+QT_WARNING_POP
+#endif
bool setContent(QXmlStreamReader *reader, bool namespaceProcessing, QString *errorMsg,
int *errorLine, int *errorColumn);
diff --git a/src/xml/dom/qdomhelpers.cpp b/src/xml/dom/qdomhelpers.cpp
index 9399ad3b9b..10e37f7c0f 100644
--- a/src/xml/dom/qdomhelpers.cpp
+++ b/src/xml/dom/qdomhelpers.cpp
@@ -44,12 +44,15 @@
QT_BEGIN_NAMESPACE
+#if QT_DEPRECATED_SINCE(5, 15)
+
/**************************************************************
*
* QDomHandler
*
**************************************************************/
-
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
QDomHandler::QDomHandler(QDomDocumentPrivate *adoc, QXmlSimpleReader *areader,
bool namespaceProcessing)
: cdata(false), reader(areader), domBuilder(adoc, &locator, namespaceProcessing)
@@ -160,6 +163,9 @@ QDomBuilder::ErrorInfo QDomHandler::errorInfo() const
{
return domBuilder.error();
}
+QT_WARNING_POP
+
+#endif // QT_DEPRECATED_SINCE(5, 15)
/**************************************************************
*
@@ -179,10 +185,15 @@ int QDomDocumentLocator::line() const
return static_cast<int>(reader->lineNumber());
}
+#if QT_DEPRECATED_SINCE(5, 15)
+
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
void QSAXDocumentLocator::setLocator(QXmlLocator *l)
{
locator = l;
}
+QT_WARNING_POP
int QSAXDocumentLocator::column() const
{
@@ -200,6 +211,8 @@ int QSAXDocumentLocator::line() const
return static_cast<int>(locator->lineNumber());
}
+#endif // QT_DEPRECATED_SINCE(5, 15)
+
/**************************************************************
*
* QDomBuilder
@@ -234,6 +247,10 @@ bool QDomBuilder::startDTD(const QString &name, const QString &publicId, const Q
return true;
}
+#if QT_DEPRECATED_SINCE(5, 15)
+
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
bool QDomBuilder::startElement(const QString &nsURI, const QString &qName,
const QXmlAttributes &atts)
{
@@ -264,6 +281,9 @@ bool QDomBuilder::startElement(const QString &nsURI, const QString &qName,
return true;
}
+QT_WARNING_POP
+
+#endif // QT_DEPRECATED_SINCE(5, 15)
inline QString stringRefToString(const QStringRef &stringRef)
{
diff --git a/src/xml/dom/qdomhelpers_p.h b/src/xml/dom/qdomhelpers_p.h
index f5efd8a42d..4de18f7d4d 100644
--- a/src/xml/dom/qdomhelpers_p.h
+++ b/src/xml/dom/qdomhelpers_p.h
@@ -93,6 +93,11 @@ private:
QXmlStreamReader *reader;
};
+#if QT_DEPRECATED_SINCE(5, 15)
+
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
+
class QSAXDocumentLocator : public QXmlDocumentLocator
{
public:
@@ -107,6 +112,10 @@ private:
QXmlLocator *locator = nullptr;
};
+QT_WARNING_POP
+
+#endif
+
/**************************************************************
*
* QDomBuilder
@@ -120,7 +129,12 @@ public:
~QDomBuilder();
bool endDocument();
+#if QT_DEPRECATED_SINCE(5, 15)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
bool startElement(const QString &nsURI, const QString &qName, const QXmlAttributes &atts);
+QT_WARNING_POP
+#endif
bool startElement(const QString &nsURI, const QString &qName, const QXmlStreamAttributes &atts);
bool endElement();
bool characters(const QString &characters, bool cdata = false);
@@ -152,12 +166,17 @@ private:
bool nsProcessing;
};
+#if QT_DEPRECATED_SINCE(5, 15)
+
/**************************************************************
*
* QDomHandler
*
**************************************************************/
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
+
class QDomHandler : public QXmlDefaultHandler
{
public:
@@ -205,6 +224,10 @@ private:
QDomBuilder domBuilder;
};
+QT_WARNING_POP
+
+#endif // QT_DEPRECATED_SINCE(5, 15)
+
/**************************************************************
*
* QDomParser