From f741a12de11c9b06d971795cf34b26afc08e3f59 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 7 Aug 2020 11:46:07 +0200 Subject: 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 --- src/corelib/itemmodels/qabstractitemmodel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/corelib/itemmodels/qabstractitemmodel.cpp') diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp index 1bb65336bf..a686e918c3 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) { -- cgit v1.2.3