diff --git a/src/corelib/serialization/qxmlstream.cpp b/src/corelib/serialization/qxmlstream.cpp index 182f3d7e1e8..88dd59a04d4 100644 --- a/src/corelib/serialization/qxmlstream.cpp +++ b/src/corelib/serialization/qxmlstream.cpp @@ -3880,6 +3880,7 @@ void QXmlStreamWriterPrivate::writeStartElement(QAnyStringView namespaceUri, QAn didWriteAnyToken = true; } +#if QT_CONFIG(xmlstreamreader) /*! Writes the current state of the \a reader. All possible valid states are supported. @@ -3943,8 +3944,9 @@ void QXmlStreamWriter::writeCurrentToken(const QXmlStreamReader &reader) break; } } - +#endif // feature xmlstreamreader #endif // feature xmlstreamwriter + #if QT_CONFIG(xmlstreamreader) static constexpr bool isTokenAllowedInContext(QXmlStreamReader::TokenType type, QXmlStreamReaderPrivate::XmlContext ctxt) diff --git a/src/corelib/serialization/qxmlstream_p.h b/src/corelib/serialization/qxmlstream_p.h index a29ee656e9e..f5695dd6670 100644 --- a/src/corelib/serialization/qxmlstream_p.h +++ b/src/corelib/serialization/qxmlstream_p.h @@ -225,7 +225,7 @@ public: } }; - +#if QT_CONFIG(xmlstreamreader) class QXmlStreamEntityResolver; class QXmlStreamReaderPrivate : public QXmlStreamGrammar, public QXmlStreamPrivateTagStack { @@ -535,6 +535,7 @@ private: type = t; } }; +#endif // feature xmlstreamreader QT_END_NAMESPACE