From 82d02b7b95908dec16e41c5af1c63579729c589b Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Thu, 7 Nov 2019 17:26:55 +0100 Subject: Deprecate SAX classes in Qt XML Deprecated the SAX classes and disabled or replaced their uses in tests if applicable. Removed the saxbookmarks example, no point in keeping examples for the deprecated code. [ChangeLog][QtXml] SAX classes are now deprecated. Use QXmlStreamReader, QXmlStreamWriter in QtCore instead. Task-number: QTBUG-76177 Change-Id: Ic171d62fa0527b0f36f94cf09a69586092269957 Reviewed-by: Friedemann Kleint Reviewed-by: Paul Wicking Reviewed-by: Kai Koehne --- src/xml/dom/qdom.cpp | 37 ++++++++++++++++++++++-- src/xml/dom/qdom.h | 12 ++++++++ src/xml/dom/qdom_p.h | 5 ++++ src/xml/dom/qdomhelpers.cpp | 22 +++++++++++++- src/xml/dom/qdomhelpers_p.h | 23 +++++++++++++++ src/xml/sax/qxml.cpp | 38 ++++++++++++++++++++++++ src/xml/sax/qxml.h | 70 ++++++++++++++++++++++++++++++++++----------- src/xml/sax/qxml_p.h | 9 ++++++ 8 files changed, 196 insertions(+), 20 deletions(-) (limited to 'src') 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(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(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 diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp index 1993073cce..0033d042d4 100644 --- a/src/xml/sax/qxml.cpp +++ b/src/xml/sax/qxml.cpp @@ -51,6 +51,7 @@ #include "qstack.h" #include +#if QT_DEPRECATED_SINCE(5, 15) #ifdef Q_CC_BOR // borland 6 finds bogus warnings when building this file in uic3 # pragma warn -8080 @@ -284,6 +285,7 @@ class QXmlDefaultHandlerPrivate /*! \class QXmlParseException + \obsolete \reentrant \brief The QXmlParseException class is used to report errors with the QXmlErrorHandler interface. @@ -403,6 +405,7 @@ QString QXmlParseException::systemId() const /*! \class QXmlLocator + \obsolete \reentrant \brief The QXmlLocator class provides the XML handler classes with information about the parsing position within a file. @@ -445,6 +448,9 @@ QXmlLocator::~QXmlLocator() number available. */ +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED + class QXmlSimpleReaderLocator : public QXmlLocator { public: @@ -497,6 +503,7 @@ public: /*! \class QXmlNamespaceSupport + \obsolete \since 4.4 \reentrant \brief The QXmlNamespaceSupport class is a helper class for XML @@ -745,6 +752,7 @@ void QXmlNamespaceSupport::reset() /*! \class QXmlAttributes + \obsolete \reentrant \brief The QXmlAttributes class provides XML attributes. @@ -1028,6 +1036,7 @@ void QXmlAttributes::append(const QString &qName, const QString &uri, const QStr /*! \class QXmlInputSource + \obsolete \reentrant \brief The QXmlInputSource class provides the input data for the QXmlReader subclasses. @@ -1446,6 +1455,7 @@ QString QXmlInputSource::fromRawData(const QByteArray &data, bool beginning) /*! \class QXmlContentHandler + \obsolete \reentrant \brief The QXmlContentHandler class provides an interface to report the logical content of XML data. @@ -1688,6 +1698,7 @@ QString QXmlInputSource::fromRawData(const QByteArray &data, bool beginning) /*! \class QXmlErrorHandler + \obsolete \reentrant \brief The QXmlErrorHandler class provides an interface to report errors in XML data. @@ -1763,6 +1774,7 @@ events are reported. /*! \class QXmlDTDHandler + \obsolete \reentrant \brief The QXmlDTDHandler class provides an interface to report DTD content of XML data. @@ -1830,6 +1842,7 @@ events are reported. /*! \class QXmlEntityResolver + \obsolete \reentrant \brief The QXmlEntityResolver class provides an interface to resolve external entities contained in XML data. @@ -1886,6 +1899,7 @@ events are reported. /*! \class QXmlLexicalHandler + \obsolete \reentrant \brief The QXmlLexicalHandler class provides an interface to report the lexical content of XML data. @@ -2037,6 +2051,7 @@ events are reported. /*! \class QXmlDeclHandler + \obsolete \reentrant \brief The QXmlDeclHandler class provides an interface to report declaration content of XML data. @@ -2124,6 +2139,7 @@ events are reported. /*! \class QXmlDefaultHandler + \obsolete \reentrant \brief The QXmlDefaultHandler class provides a default implementation of all the XML handler classes. @@ -2558,6 +2574,7 @@ void QXmlSimpleReaderPrivate::initIncrementalParsing() /*! \class QXmlReader + \obsolete \reentrant \brief The QXmlReader class provides an interface for XML readers (i.e. parsers). @@ -2597,6 +2614,9 @@ void QXmlSimpleReaderPrivate::initIncrementalParsing() setDeclHandler(). The parse itself is started with a call to parse(). + Note that this class is now deprecated, please use QXmlStreamReader or + QDomDocument for reading XML files. + \sa QXmlSimpleReader */ @@ -2783,6 +2803,7 @@ void QXmlSimpleReaderPrivate::initIncrementalParsing() /*! \class QXmlSimpleReader + \obsolete \nonreentrant \brief The QXmlSimpleReader class provides an implementation of a simple XML parser. @@ -2845,6 +2866,9 @@ void QXmlSimpleReaderPrivate::initIncrementalParsing() QXmlSimpleReader is not reentrant. If you want to use the class in threaded code, lock the code using QXmlSimpleReader with a locking mechanism, such as a QMutex. + + Note that this class is now deprecated, please use QXmlStreamReader or + QDomDocument for reading XML files. */ static inline bool is_S(QChar ch) @@ -5255,7 +5279,10 @@ bool QXmlSimpleReaderPrivate::parsePEReference() } else if (entityRes) { QMap::Iterator it2; it2 = externParameterEntities.find(ref()); +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED QXmlInputSource *ret = nullptr; +QT_WARNING_POP if (it2 != externParameterEntities.end()) { if (!entityRes->resolveEntity((*it2).publicId, (*it2).systemId, ret)) { delete ret; @@ -7610,7 +7637,10 @@ bool QXmlSimpleReaderPrivate::processReference() // Included if validating bool skipIt = true; if (entityRes) { +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED QXmlInputSource *ret = nullptr; +QT_WARNING_POP if (!entityRes->resolveEntity((*itExtern).publicId, (*itExtern).systemId, ret)) { delete ret; reportParseError(entityRes->errorString()); @@ -7850,6 +7880,8 @@ bool QXmlSimpleReaderPrivate::next_eat_ws() This private function initializes the reader. \a i is the input source to read the data from. */ +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED void QXmlSimpleReaderPrivate::init(const QXmlInputSource *i) { lineNr = 0; @@ -7870,6 +7902,7 @@ void QXmlSimpleReaderPrivate::init(const QXmlInputSource *i) standalone = QXmlSimpleReaderPrivate::Unknown; error.clear(); } +QT_WARNING_POP /* This private function initializes the XML data related variables. Especially, @@ -7898,6 +7931,8 @@ bool QXmlSimpleReaderPrivate::entityExist(const QString& e) const } } +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED void QXmlSimpleReaderPrivate::reportParseError(const QString& error) { this->error = error; @@ -7913,6 +7948,7 @@ void QXmlSimpleReaderPrivate::reportParseError(const QString& error) } } } +QT_WARNING_POP /* This private function is called when a parsing function encounters an @@ -8006,3 +8042,5 @@ void QXmlSimpleReaderPrivate::refAddC(QChar ch) refArray[refArrayPos++] = ch; } QT_END_NAMESPACE + +#endif // QT_DEPRECATED_SINCE(5, 15) diff --git a/src/xml/sax/qxml.h b/src/xml/sax/qxml.h index 9be14bd7a9..e19a398ca7 100644 --- a/src/xml/sax/qxml.h +++ b/src/xml/sax/qxml.h @@ -40,6 +40,26 @@ #ifndef QXML_H #define QXML_H +#if 0 +// This is needed because of QTBUG-80347 +#pragma qt_class(QXmlNamespaceSupport) +#pragma qt_class(QXmlAttributes) +#pragma qt_class(QXmlInputSource) +#pragma qt_class(QXmlParseException) +#pragma qt_class(QXmlReader) +#pragma qt_class(QXmlSimpleReader) +#pragma qt_class(QXmlLocator) +#pragma qt_class(QXmlContentHandler) +#pragma qt_class(QXmlErrorHandler) +#pragma qt_class(QXmlDTDHandler) +#pragma qt_class(QXmlEntityResolver) +#pragma qt_class(QXmlLexicalHandler) +#pragma qt_class(QXmlDeclHandler) +#pragma qt_class(QXmlDefaultHandler) +#endif + +#include + #include #include #include @@ -48,8 +68,12 @@ #include #include +#if QT_DEPRECATED_SINCE(5, 15) + QT_BEGIN_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED class QXmlNamespaceSupport; class QXmlAttributes; @@ -76,12 +100,11 @@ class QXmlParseExceptionPrivate; class QXmlLocatorPrivate; class QXmlDefaultHandlerPrivate; - // // SAX Namespace Support // -class Q_XML_EXPORT QXmlNamespaceSupport +class QT_DEPRECATED_VERSION(5, 15) Q_XML_EXPORT QXmlNamespaceSupport { public: QXmlNamespaceSupport(); @@ -112,10 +135,15 @@ private: // SAX Attributes // +// Although deprecated warnings are disabled, the intel icc 18 compiler +// still complains during the instantiation of the templated qSwap() call below +// (with the parameter QXmlAttributes::AttributeList) when QXmlAttributes is +// deprecated. This makes the build fail when warnings are treated as errors. +// To workaround this, deprecated only the constructor. class Q_XML_EXPORT QXmlAttributes { public: - QXmlAttributes(); + QT_DEPRECATED_VERSION(5, 15) QXmlAttributes(); QXmlAttributes(const QXmlAttributes &) = default; QXmlAttributes(QXmlAttributes &&) noexcept = default; QXmlAttributes &operator=(const QXmlAttributes &) = default; @@ -158,6 +186,7 @@ private: QXmlAttributesPrivate *d; }; + Q_DECLARE_TYPEINFO(QXmlAttributes::Attribute, Q_MOVABLE_TYPE); Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QXmlAttributes) @@ -165,7 +194,7 @@ Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QXmlAttributes) // SAX Input Source // -class Q_XML_EXPORT QXmlInputSource +class QT_DEPRECATED_VERSION(5, 15) Q_XML_EXPORT QXmlInputSource { public: QXmlInputSource(); @@ -194,7 +223,7 @@ private: // SAX Exception Classes // -class Q_XML_EXPORT QXmlParseException +class QT_DEPRECATED_VERSION(5, 15) Q_XML_EXPORT QXmlParseException { public: explicit QXmlParseException(const QString &name = QString(), int c = -1, int l = -1, @@ -217,7 +246,7 @@ private: // XML Reader // -class Q_XML_EXPORT QXmlReader +class QT_DEPRECATED_VERSION_X(5, 15, "Use QXmlStreamReader") Q_XML_EXPORT QXmlReader { public: virtual ~QXmlReader() {} @@ -243,7 +272,8 @@ public: virtual bool parse(const QXmlInputSource* input) = 0; }; -class Q_XML_EXPORT QXmlSimpleReader : public QXmlReader +class QT_DEPRECATED_VERSION_X(5, 15, "Use QXmlStreamReader") Q_XML_EXPORT QXmlSimpleReader + : public QXmlReader { public: QXmlSimpleReader(); @@ -288,7 +318,7 @@ private: // SAX Locator // -class Q_XML_EXPORT QXmlLocator +class QT_DEPRECATED_VERSION(5, 15) Q_XML_EXPORT QXmlLocator { public: QXmlLocator(); @@ -304,7 +334,7 @@ public: // SAX handler classes // -class Q_XML_EXPORT QXmlContentHandler +class QT_DEPRECATED_VERSION(5, 15) Q_XML_EXPORT QXmlContentHandler { public: virtual ~QXmlContentHandler() {} @@ -322,7 +352,7 @@ public: virtual QString errorString() const = 0; }; -class Q_XML_EXPORT QXmlErrorHandler +class QT_DEPRECATED_VERSION(5, 15) Q_XML_EXPORT QXmlErrorHandler { public: virtual ~QXmlErrorHandler() {} @@ -332,7 +362,7 @@ public: virtual QString errorString() const = 0; }; -class Q_XML_EXPORT QXmlDTDHandler +class QT_DEPRECATED_VERSION(5, 15) Q_XML_EXPORT QXmlDTDHandler { public: virtual ~QXmlDTDHandler() {} @@ -341,7 +371,7 @@ public: virtual QString errorString() const = 0; }; -class Q_XML_EXPORT QXmlEntityResolver +class QT_DEPRECATED_VERSION(5, 15) Q_XML_EXPORT QXmlEntityResolver { public: virtual ~QXmlEntityResolver() {} @@ -349,7 +379,7 @@ public: virtual QString errorString() const = 0; }; -class Q_XML_EXPORT QXmlLexicalHandler +class QT_DEPRECATED_VERSION(5, 15) Q_XML_EXPORT QXmlLexicalHandler { public: virtual ~QXmlLexicalHandler() {} @@ -363,7 +393,7 @@ public: virtual QString errorString() const = 0; }; -class Q_XML_EXPORT QXmlDeclHandler +class QT_DEPRECATED_VERSION(5, 15) Q_XML_EXPORT QXmlDeclHandler { public: virtual ~QXmlDeclHandler() {} @@ -374,8 +404,12 @@ public: // ### Conform to SAX by adding elementDecl }; - -class Q_XML_EXPORT QXmlDefaultHandler : public QXmlContentHandler, public QXmlErrorHandler, public QXmlDTDHandler, public QXmlEntityResolver, public QXmlLexicalHandler, public QXmlDeclHandler +class QT_DEPRECATED_VERSION(5, 15) Q_XML_EXPORT QXmlDefaultHandler : public QXmlContentHandler, + public QXmlErrorHandler, + public QXmlDTDHandler, + public QXmlEntityResolver, + public QXmlLexicalHandler, + public QXmlDeclHandler { public: QXmlDefaultHandler(); @@ -426,6 +460,10 @@ private: inline int QXmlAttributes::count() const { return length(); } +QT_WARNING_POP + QT_END_NAMESPACE +#endif // QT_DEPRECATED_SINCE(5, 15) + #endif // QXML_H diff --git a/src/xml/sax/qxml_p.h b/src/xml/sax/qxml_p.h index eb6135db04..1b614dd886 100644 --- a/src/xml/sax/qxml_p.h +++ b/src/xml/sax/qxml_p.h @@ -46,6 +46,8 @@ #include +#if QT_DEPRECATED_SINCE(5, 15) + QT_BEGIN_NAMESPACE // @@ -59,6 +61,9 @@ QT_BEGIN_NAMESPACE // We mean it. // +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED + class QXmlSimpleReaderPrivate { public: @@ -313,6 +318,10 @@ Q_DECLARE_TYPEINFO(QXmlSimpleReaderPrivate::XmlRef, Q_MOVABLE_TYPE); Q_DECLARE_TYPEINFO(QXmlSimpleReaderPrivate::ExternParameterEntity, Q_MOVABLE_TYPE); Q_DECLARE_TYPEINFO(QXmlSimpleReaderPrivate::ExternEntity, Q_MOVABLE_TYPE); +QT_WARNING_POP + QT_END_NAMESPACE +#endif // QT_DEPRECATED_SINCE(5, 15) + #endif // QXML_P_H -- cgit v1.2.3