summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qiodevice.h
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/io/qiodevice.h
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/io/qiodevice.h')
-rw-r--r--src/corelib/io/qiodevice.h22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/corelib/io/qiodevice.h b/src/corelib/io/qiodevice.h
index 7012bbacba..fa43efdb4d 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 <QtCore/qglobal.h>
+#include <QtCore/qiodevicebase.h>
#ifndef QT_NO_QOBJECT
#include <QtCore/qobject.h>
#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);