From f741a12de11c9b06d971795cf34b26afc08e3f59 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 7 Aug 2020 11:46:07 +0200 Subject: [PATCH] Disentangle QIODevice dependencies Move the QIODevice::OpenMode enum into a base class, so that we can remove the full QIODevice (and thus QObject) dependency from qdatastream.h and qtextstream.h. This is required so that we can include QDataStream in qmetatype.h without getting circular dependencies. As a nice side effect, QDataStream and QTextStream can now inherit QIODeviceBase and provide the OpenMode enum directly in their class scope. Change-Id: Ifa68b7b1d8d95687ed032f6c9206f92e63bfacdf Reviewed-by: Paul Wicking Reviewed-by: Maurice Kalinowski --- .../widgets/itemviews/puzzle/piecesmodel.cpp | 4 +- qmake/CMakeLists.txt | 1 + src/corelib/CMakeLists.txt | 1 + src/corelib/io/io.pri | 1 + src/corelib/io/qdebug.h | 6 +- src/corelib/io/qiodevice.cpp | 2 +- src/corelib/io/qiodevice.h | 22 ++---- src/corelib/io/qiodevicebase.h | 67 +++++++++++++++++++ src/corelib/itemmodels/qabstractitemmodel.cpp | 8 +-- src/corelib/kernel/qmetatype.h | 1 + .../serialization/qcborstreamreader.cpp | 1 + src/corelib/serialization/qdatastream.cpp | 12 +++- src/corelib/serialization/qdatastream.h | 10 +-- src/corelib/serialization/qtextstream.cpp | 12 ++-- src/corelib/serialization/qtextstream.h | 18 ++--- src/corelib/serialization/qtextstream_p.h | 2 + src/gui/itemmodels/qstandarditemmodel.cpp | 1 + src/gui/rhi/qrhiprofiler.cpp | 1 + src/gui/util/qktxhandler.cpp | 1 + src/network/ssl/qasn1element.cpp | 2 +- src/tools/qlalr/lalr.cpp | 4 +- src/tools/qlalr/lalr.h | 1 + src/xml/dom/qdom_p.h | 1 + src/xml/sax/qxml_p.h | 1 + 24 files changed, 130 insertions(+), 50 deletions(-) create mode 100644 src/corelib/io/qiodevicebase.h diff --git a/examples/widgets/itemviews/puzzle/piecesmodel.cpp b/examples/widgets/itemviews/puzzle/piecesmodel.cpp index a9c53ed2cd9..f20fb9f7c35 100644 --- a/examples/widgets/itemviews/puzzle/piecesmodel.cpp +++ b/examples/widgets/itemviews/puzzle/piecesmodel.cpp @@ -132,7 +132,7 @@ QMimeData *PiecesModel::mimeData(const QModelIndexList &indexes) const QMimeData *mimeData = new QMimeData(); QByteArray encodedData; - QDataStream stream(&encodedData, QIODevice::WriteOnly); + QDataStream stream(&encodedData, QDataStream::WriteOnly); for (const QModelIndex &index : indexes) { if (index.isValid()) { @@ -170,7 +170,7 @@ bool PiecesModel::dropMimeData(const QMimeData *data, Qt::DropAction action, } QByteArray encodedData = data->data("image/x-puzzle-piece"); - QDataStream stream(&encodedData, QIODevice::ReadOnly); + QDataStream stream(&encodedData, QDataStream::ReadOnly); while (!stream.atEnd()) { QPixmap pixmap; diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index 9e2c7b513cd..2a7549f862c 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -61,6 +61,7 @@ qt_add_tool(${target_name} ../src/corelib/io/qfilesystementry.cpp ../src/corelib/io/qfsfileengine.cpp ../src/corelib/io/qfsfileengine_iterator.cpp + ../src/corelib/io/qiodevicebase.h ../src/corelib/io/qiodevice.cpp ../src/corelib/io/qiodevice.h ../src/corelib/io/qsettings.cpp ../src/corelib/io/qtemporaryfile.cpp ../src/corelib/io/qtemporaryfile.h diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index ec4f1076bed..6f78e2bdc68 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -71,6 +71,7 @@ qt_add_module(Core io/qfilesystemmetadata_p.h io/qfsfileengine.cpp io/qfsfileengine_p.h io/qfsfileengine_iterator.cpp io/qfsfileengine_iterator_p.h + io/qiodevicebase.h io/qiodevice.cpp io/qiodevice.h io/qiodevice_p.h io/qipaddress.cpp io/qipaddress_p.h io/qlockfile.cpp io/qlockfile.h io/qlockfile_p.h diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri index c062d9948b6..0808114bd34 100644 --- a/src/corelib/io/io.pri +++ b/src/corelib/io/io.pri @@ -15,6 +15,7 @@ HEADERS += \ io/qfileinfo.h \ io/qfileinfo_p.h \ io/qipaddress_p.h \ + io/qiodevicebase.h \ io/qiodevice.h \ io/qiodevice_p.h \ io/qlockfile.h \ diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 130ceccc44c..2463095743d 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE -class Q_CORE_EXPORT QDebug +class Q_CORE_EXPORT QDebug : public QIODeviceBase { friend class QMessageLogger; friend class QDebugStateSaver; @@ -70,9 +70,9 @@ class Q_CORE_EXPORT QDebug Stream(QIODevice *device) : ts(device), ref(1), type(QtDebugMsg), space(true), message_output(false), flags(DefaultVerbosity << VerbosityShift) {} - Stream(QString *string) : ts(string, QIODevice::WriteOnly), ref(1), type(QtDebugMsg), + Stream(QString *string) : ts(string, WriteOnly), ref(1), type(QtDebugMsg), space(true), message_output(false), flags(DefaultVerbosity << VerbosityShift) {} - Stream(QtMsgType t) : ts(&buffer, QIODevice::WriteOnly), ref(1), type(t), + Stream(QtMsgType t) : ts(&buffer, WriteOnly), ref(1), type(t), space(true), message_output(true), flags(DefaultVerbosity << VerbosityShift) {} QTextStream ts; QString buffer; diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index c29501404b2..3d64e8820f3 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -305,7 +305,7 @@ QIODevicePrivate::~QIODevicePrivate() */ /*! - \enum QIODevice::OpenModeFlag + \enum QIODeviceBase::OpenModeFlag This enum is used with open() to describe the mode in which a device is opened. It is also returned by openMode(). diff --git a/src/corelib/io/qiodevice.h b/src/corelib/io/qiodevice.h index 7012bbacbaf..fa43efdb4d5 100644 --- a/src/corelib/io/qiodevice.h +++ b/src/corelib/io/qiodevice.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -41,6 +41,7 @@ #define QIODEVICE_H #include +#include #ifndef QT_NO_QOBJECT #include #else @@ -61,27 +62,16 @@ class QIODevicePrivate; class Q_CORE_EXPORT QIODevice #ifndef QT_NO_QOBJECT - : public QObject + : public QObject, +#else + : #endif + public QIODeviceBase { #ifndef QT_NO_QOBJECT Q_OBJECT #endif public: - enum OpenModeFlag { - NotOpen = 0x0000, - ReadOnly = 0x0001, - WriteOnly = 0x0002, - ReadWrite = ReadOnly | WriteOnly, - Append = 0x0004, - Truncate = 0x0008, - Text = 0x0010, - Unbuffered = 0x0020, - NewOnly = 0x0040, - ExistingOnly = 0x0080 - }; - Q_DECLARE_FLAGS(OpenMode, OpenModeFlag) - QIODevice(); #ifndef QT_NO_QOBJECT explicit QIODevice(QObject *parent); diff --git a/src/corelib/io/qiodevicebase.h b/src/corelib/io/qiodevicebase.h new file mode 100644 index 00000000000..f1032a1dde5 --- /dev/null +++ b/src/corelib/io/qiodevicebase.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QIODEVICEBASE_H +#define QIODEVICEBASE_H + +#include + +QT_BEGIN_NAMESPACE + +class QIODeviceBase +{ +public: + enum OpenModeFlag { + NotOpen = 0x0000, + ReadOnly = 0x0001, + WriteOnly = 0x0002, + ReadWrite = ReadOnly | WriteOnly, + Append = 0x0004, + Truncate = 0x0008, + Text = 0x0010, + Unbuffered = 0x0020, + NewOnly = 0x0040, + ExistingOnly = 0x0080 + }; + Q_DECLARE_FLAGS(OpenMode, OpenModeFlag) +}; + +QT_END_NAMESPACE + +#endif // QIODEVICEBASE_H diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp index 1bb65336bfd..a686e918c3f 100644 --- a/src/corelib/itemmodels/qabstractitemmodel.cpp +++ b/src/corelib/itemmodels/qabstractitemmodel.cpp @@ -1919,7 +1919,7 @@ QMimeData *QAbstractItemModel::mimeData(const QModelIndexList &indexes) const QMimeData *data = new QMimeData(); QString format = types.at(0); QByteArray encoded; - QDataStream stream(&encoded, QIODevice::WriteOnly); + QDataStream stream(&encoded, QDataStream::WriteOnly); encodeData(indexes, stream); data->setData(format, encoded); return data; @@ -2007,7 +2007,7 @@ bool QAbstractItemModel::dropMimeData(const QMimeData *data, Qt::DropAction acti column = 0; // decode and insert QByteArray encoded = data->data(format); - QDataStream stream(&encoded, QIODevice::ReadOnly); + QDataStream stream(&encoded, QDataStream::ReadOnly); return decodeData(row, column, parent, stream); } @@ -3730,7 +3730,7 @@ bool QAbstractTableModel::dropMimeData(const QMimeData *data, Qt::DropAction act return false; QByteArray encoded = data->data(format); - QDataStream stream(&encoded, QIODevice::ReadOnly); + QDataStream stream(&encoded, QDataStream::ReadOnly); // if the drop is on an item, replace the data in the items if (parent.isValid() && row == -1 && column == -1) { @@ -3781,7 +3781,7 @@ bool QAbstractListModel::dropMimeData(const QMimeData *data, Qt::DropAction acti return false; QByteArray encoded = data->data(format); - QDataStream stream(&encoded, QIODevice::ReadOnly); + QDataStream stream(&encoded, QDataStream::ReadOnly); // if the drop is on an item, replace the data in the items if (parent.isValid() && row == -1 && column == -1) { diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 527feffa548..a7916cfb137 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -47,6 +47,7 @@ #include #include #include +#include #ifndef QT_NO_QOBJECT #include #endif diff --git a/src/corelib/serialization/qcborstreamreader.cpp b/src/corelib/serialization/qcborstreamreader.cpp index 308fbe9ae97..c5d0c855e30 100644 --- a/src/corelib/serialization/qcborstreamreader.cpp +++ b/src/corelib/serialization/qcborstreamreader.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include diff --git a/src/corelib/serialization/qdatastream.cpp b/src/corelib/serialization/qdatastream.cpp index 7888296b85f..c6135336cf0 100644 --- a/src/corelib/serialization/qdatastream.cpp +++ b/src/corelib/serialization/qdatastream.cpp @@ -302,7 +302,7 @@ QDataStream::QDataStream(QIODevice *d) } /*! - \fn QDataStream::QDataStream(QByteArray *a, QIODevice::OpenMode mode) + \fn QDataStream::QDataStream(QByteArray *a, OpenMode mode) Constructs a data stream that operates on a byte array, \a a. The \a mode describes how the device is to be used. @@ -314,7 +314,7 @@ QDataStream::QDataStream(QIODevice *d) is created to wrap the byte array. */ -QDataStream::QDataStream(QByteArray *a, QIODevice::OpenMode flags) +QDataStream::QDataStream(QByteArray *a, OpenMode flags) { QBuffer *buf = new QBuffer(a); #ifndef QT_NO_QOBJECT @@ -755,6 +755,14 @@ void QDataStream::abortTransaction() dev->commitTransaction(); } +/*! + \internal +*/ +bool QDataStream::isDeviceTransactionStarted() const +{ + return dev && dev->isTransactionStarted(); +} + /***************************************************************************** QDataStream read functions *****************************************************************************/ diff --git a/src/corelib/serialization/qdatastream.h b/src/corelib/serialization/qdatastream.h index 095a6681c2e..ad47490ebf3 100644 --- a/src/corelib/serialization/qdatastream.h +++ b/src/corelib/serialization/qdatastream.h @@ -41,8 +41,7 @@ #define QDATASTREAM_H #include -#include -#include +#include #include #ifdef Status @@ -60,7 +59,7 @@ class QDataStreamPrivate; namespace QtPrivate { class StreamStateSaver; } -class Q_CORE_EXPORT QDataStream +class Q_CORE_EXPORT QDataStream : public QIODeviceBase { public: enum Version { @@ -122,7 +121,7 @@ public: QDataStream(); explicit QDataStream(QIODevice *); - QDataStream(QByteArray *, QIODevice::OpenMode flags); + QDataStream(QByteArray *, OpenMode flags); QDataStream(const QByteArray &); ~QDataStream(); @@ -199,6 +198,7 @@ public: void rollbackTransaction(); void abortTransaction(); + bool isDeviceTransactionStarted() const; private: Q_DISABLE_COPY(QDataStream) @@ -222,7 +222,7 @@ class StreamStateSaver public: inline StreamStateSaver(QDataStream *s) : stream(s), oldStatus(s->status()) { - if (!stream->dev || !stream->dev->isTransactionStarted()) + if (!stream->isDeviceTransactionStarted()) stream->resetStatus(); } inline ~StreamStateSaver() diff --git a/src/corelib/serialization/qtextstream.cpp b/src/corelib/serialization/qtextstream.cpp index c834f22834c..9ba65ba02b6 100644 --- a/src/corelib/serialization/qtextstream.cpp +++ b/src/corelib/serialization/qtextstream.cpp @@ -368,7 +368,7 @@ void QTextStreamPrivate::reset() deleteDevice = false; string = nullptr; stringOffset = 0; - stringOpenMode = QIODevice::NotOpen; + stringOpenMode = QTextStream::NotOpen; readBufferOffset = 0; readBufferStartDevicePos = 0; @@ -983,7 +983,7 @@ QTextStream::QTextStream(QIODevice *device) Constructs a QTextStream that operates on \a string, using \a openMode to define the open mode. */ -QTextStream::QTextStream(QString *string, QIODevice::OpenMode openMode) +QTextStream::QTextStream(QString *string, OpenMode openMode) : d_ptr(new QTextStreamPrivate(this)) { #if defined (QTEXTSTREAM_DEBUG) @@ -1001,7 +1001,7 @@ QTextStream::QTextStream(QString *string, QIODevice::OpenMode openMode) openMode to define the open mode. Internally, the array is wrapped by a QBuffer. */ -QTextStream::QTextStream(QByteArray *array, QIODevice::OpenMode openMode) +QTextStream::QTextStream(QByteArray *array, OpenMode openMode) : d_ptr(new QTextStreamPrivate(this)) { #if defined (QTEXTSTREAM_DEBUG) @@ -1028,7 +1028,7 @@ QTextStream::QTextStream(QByteArray *array, QIODevice::OpenMode openMode) \snippet code/src_corelib_io_qtextstream.cpp 3 */ -QTextStream::QTextStream(const QByteArray &array, QIODevice::OpenMode openMode) +QTextStream::QTextStream(const QByteArray &array, OpenMode openMode) : d_ptr(new QTextStreamPrivate(this)) { #if defined (QTEXTSTREAM_DEBUG) @@ -1059,7 +1059,7 @@ QTextStream::QTextStream(const QByteArray &array, QIODevice::OpenMode openMode) \snippet code/src_corelib_io_qtextstream.cpp 4 */ -QTextStream::QTextStream(FILE *fileHandle, QIODevice::OpenMode openMode) +QTextStream::QTextStream(FILE *fileHandle, OpenMode openMode) : d_ptr(new QTextStreamPrivate(this)) { #if defined (QTEXTSTREAM_DEBUG) @@ -1272,7 +1272,7 @@ QIODevice *QTextStream::device() const \sa string(), setDevice() */ -void QTextStream::setString(QString *string, QIODevice::OpenMode openMode) +void QTextStream::setString(QString *string, OpenMode openMode) { Q_D(QTextStream); flush(); diff --git a/src/corelib/serialization/qtextstream.h b/src/corelib/serialization/qtextstream.h index a3526c84fc2..b196e9e935f 100644 --- a/src/corelib/serialization/qtextstream.h +++ b/src/corelib/serialization/qtextstream.h @@ -40,10 +40,9 @@ #ifndef QTEXTSTREAM_H #define QTEXTSTREAM_H -#include +#include #include #include -#include #include #include @@ -55,8 +54,11 @@ QT_BEGIN_NAMESPACE +class QIODevice; +class QLocale; + class QTextStreamPrivate; -class Q_CORE_EXPORT QTextStream // text stream class +class Q_CORE_EXPORT QTextStream : public QIODeviceBase { Q_DECLARE_PRIVATE(QTextStream) @@ -89,10 +91,10 @@ public: QTextStream(); explicit QTextStream(QIODevice *device); - explicit QTextStream(FILE *fileHandle, QIODevice::OpenMode openMode = QIODevice::ReadWrite); - explicit QTextStream(QString *string, QIODevice::OpenMode openMode = QIODevice::ReadWrite); - explicit QTextStream(QByteArray *array, QIODevice::OpenMode openMode = QIODevice::ReadWrite); - explicit QTextStream(const QByteArray &array, QIODevice::OpenMode openMode = QIODevice::ReadOnly); + explicit QTextStream(FILE *fileHandle, OpenMode openMode = ReadWrite); + explicit QTextStream(QString *string, OpenMode openMode = ReadWrite); + explicit QTextStream(QByteArray *array, OpenMode openMode = ReadWrite); + explicit QTextStream(const QByteArray &array, OpenMode openMode = ReadOnly); virtual ~QTextStream(); void setEncoding(QStringConverter::Encoding encoding); @@ -108,7 +110,7 @@ public: void setDevice(QIODevice *device); QIODevice *device() const; - void setString(QString *string, QIODevice::OpenMode openMode = QIODevice::ReadWrite); + void setString(QString *string, OpenMode openMode = ReadWrite); QString *string() const; Status status() const; diff --git a/src/corelib/serialization/qtextstream_p.h b/src/corelib/serialization/qtextstream_p.h index cee79a7ecf3..067a5ec94a3 100644 --- a/src/corelib/serialization/qtextstream_p.h +++ b/src/corelib/serialization/qtextstream_p.h @@ -53,6 +53,8 @@ // #include +#include "qiodevice.h" +#include "qlocale.h" #include "qtextstream.h" QT_BEGIN_NAMESPACE diff --git a/src/gui/itemmodels/qstandarditemmodel.cpp b/src/gui/itemmodels/qstandarditemmodel.cpp index 9bb0d9aa983..cf905eae664 100644 --- a/src/gui/itemmodels/qstandarditemmodel.cpp +++ b/src/gui/itemmodels/qstandarditemmodel.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include diff --git a/src/gui/rhi/qrhiprofiler.cpp b/src/gui/rhi/qrhiprofiler.cpp index d2fbc6158b3..e5ed15ed5a6 100644 --- a/src/gui/rhi/qrhiprofiler.cpp +++ b/src/gui/rhi/qrhiprofiler.cpp @@ -36,6 +36,7 @@ #include "qrhiprofiler_p_p.h" #include "qrhi_p_p.h" +#include QT_BEGIN_NAMESPACE diff --git a/src/gui/util/qktxhandler.cpp b/src/gui/util/qktxhandler.cpp index f6aa46718df..f65eed72900 100644 --- a/src/gui/util/qktxhandler.cpp +++ b/src/gui/util/qktxhandler.cpp @@ -41,6 +41,7 @@ #include "qtexturefiledata_p.h" #include #include +#include //#define KTX_DEBUG #ifdef KTX_DEBUG diff --git a/src/network/ssl/qasn1element.cpp b/src/network/ssl/qasn1element.cpp index a01927b84db..65a0e08961b 100644 --- a/src/network/ssl/qasn1element.cpp +++ b/src/network/ssl/qasn1element.cpp @@ -186,7 +186,7 @@ QAsn1Element QAsn1Element::fromVector(const QList &items) { QAsn1Element seq; seq.mType = SequenceType; - QDataStream stream(&seq.mValue, QIODevice::WriteOnly); + QDataStream stream(&seq.mValue, QDataStream::WriteOnly); for (auto it = items.cbegin(), end = items.cend(); it != end; ++it) it->write(stream); return seq; diff --git a/src/tools/qlalr/lalr.cpp b/src/tools/qlalr/lalr.cpp index c3d3da41fa9..853465c272c 100644 --- a/src/tools/qlalr/lalr.cpp +++ b/src/tools/qlalr/lalr.cpp @@ -42,13 +42,13 @@ QT_BEGIN_NAMESPACE QTextStream &qerr() { - static QTextStream result(stderr, QIODevice::WriteOnly); + static QTextStream result(stderr, QTextStream::WriteOnly); return result; } QTextStream &qout() { - static QTextStream result(stdout, QIODevice::WriteOnly); + static QTextStream result(stdout, QTextStream::WriteOnly); return result; } QT_END_NAMESPACE diff --git a/src/tools/qlalr/lalr.h b/src/tools/qlalr/lalr.h index 16c957624fe..5be44fea671 100644 --- a/src/tools/qlalr/lalr.h +++ b/src/tools/qlalr/lalr.h @@ -39,6 +39,7 @@ #include #include #include +#include class Rule; class State; diff --git a/src/xml/dom/qdom_p.h b/src/xml/dom/qdom_p.h index a9399d99012..8ab81aa083a 100644 --- a/src/xml/dom/qdom_p.h +++ b/src/xml/dom/qdom_p.h @@ -46,6 +46,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE diff --git a/src/xml/sax/qxml_p.h b/src/xml/sax/qxml_p.h index 1b614dd8862..4f5568f2143 100644 --- a/src/xml/sax/qxml_p.h +++ b/src/xml/sax/qxml_p.h @@ -42,6 +42,7 @@ #include #include +#include #include #include