path: root/examples/widgets
diff options
authorLars Knoll <>2020-08-07 11:46:07 +0200
committerLars Knoll <>2020-08-15 20:55:31 +0200
commitf741a12de11c9b06d971795cf34b26afc08e3f59 (patch)
tree91084bd3a88a7674d65806dd2d068ebcc372e5cd /examples/widgets
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 <> Reviewed-by: Maurice Kalinowski <>
Diffstat (limited to 'examples/widgets')
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/widgets/itemviews/puzzle/piecesmodel.cpp b/examples/widgets/itemviews/puzzle/piecesmodel.cpp
index a9c53ed2cd..f20fb9f7c3 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;