summaryrefslogtreecommitdiffstats
path: root/src/corelib/itemmodels
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-08-07 11:46:07 +0200
committerLars Knoll <lars.knoll@qt.io>2020-08-15 20:55:31 +0200
commitf741a12de11c9b06d971795cf34b26afc08e3f59 (patch)
tree91084bd3a88a7674d65806dd2d068ebcc372e5cd /src/corelib/itemmodels
parent5e3b7effbd7f70682d5a15ccd277e7f49c1e259e (diff)
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 <paul.wicking@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'src/corelib/itemmodels')
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp8
1 files changed, 4 insertions, 4 deletions
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) {