From a0f3b2b50322a2aa40d4c688279cbef65791adcb Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 26 Nov 2018 11:03:36 +0100 Subject: QtGui: Use Q_DISABLE_COPY_MOVE for QPA interface classes Introduce Q_DISABLE_COPY_MOVE or replace existing Q_DISABLE_COPY and add default constructors where needed. Change-Id: Ibd14ee9d1d69e64f6289efe789d4b64a3d6cb998 Reviewed-by: Ulf Hermann --- src/gui/kernel/qplatformclipboard.h | 3 +++ src/gui/kernel/qplatformcursor.h | 2 ++ src/gui/kernel/qplatformdrag.h | 4 ++-- src/gui/kernel/qplatformintegration.h | 4 ++++ src/gui/kernel/qplatformscreen.h | 4 ++-- src/gui/kernel/qplatformservices.h | 2 ++ src/gui/kernel/qplatformsessionmanager.h | 4 ++-- src/gui/kernel/qplatformsurface.h | 2 ++ src/gui/kernel/qplatformtheme.h | 4 ++-- src/gui/kernel/qplatformwindow.h | 4 ++-- 10 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/gui/kernel/qplatformclipboard.h b/src/gui/kernel/qplatformclipboard.h index 60733b0a9f..3220201720 100644 --- a/src/gui/kernel/qplatformclipboard.h +++ b/src/gui/kernel/qplatformclipboard.h @@ -61,6 +61,9 @@ QT_BEGIN_NAMESPACE class Q_GUI_EXPORT QPlatformClipboard { public: + Q_DISABLE_COPY_MOVE(QPlatformClipboard) + + QPlatformClipboard() = default; virtual ~QPlatformClipboard(); virtual QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard); diff --git a/src/gui/kernel/qplatformcursor.h b/src/gui/kernel/qplatformcursor.h index 40e8a562f8..f36a73c861 100644 --- a/src/gui/kernel/qplatformcursor.h +++ b/src/gui/kernel/qplatformcursor.h @@ -78,6 +78,8 @@ private: class Q_GUI_EXPORT QPlatformCursor : public QObject { public: + Q_DISABLE_COPY_MOVE(QPlatformCursor) + enum Capability { OverrideCursor = 0x1 }; diff --git a/src/gui/kernel/qplatformdrag.h b/src/gui/kernel/qplatformdrag.h index 9d4e352b4b..0c99539357 100644 --- a/src/gui/kernel/qplatformdrag.h +++ b/src/gui/kernel/qplatformdrag.h @@ -91,6 +91,8 @@ class Q_GUI_EXPORT QPlatformDrag { Q_DECLARE_PRIVATE(QPlatformDrag) public: + Q_DISABLE_COPY_MOVE(QPlatformDrag) + QPlatformDrag(); virtual ~QPlatformDrag(); @@ -108,8 +110,6 @@ public: private: QPlatformDragPrivate *d_ptr; - - Q_DISABLE_COPY(QPlatformDrag) }; QT_END_NAMESPACE diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h index efb1481f6d..de5f9c1c9a 100644 --- a/src/gui/kernel/qplatformintegration.h +++ b/src/gui/kernel/qplatformintegration.h @@ -84,6 +84,8 @@ class QVulkanInstance; class Q_GUI_EXPORT QPlatformIntegration { public: + Q_DISABLE_COPY_MOVE(QPlatformIntegration) + enum Capability { ThreadedPixmaps = 1, OpenGL, @@ -199,6 +201,8 @@ public: #endif protected: + QPlatformIntegration() = default; + void screenAdded(QPlatformScreen *screen, bool isPrimary = false); void destroyScreen(QPlatformScreen *screen); void setPrimaryScreen(QPlatformScreen *newPrimary); diff --git a/src/gui/kernel/qplatformscreen.h b/src/gui/kernel/qplatformscreen.h index e9d64c8a29..b9ecc80320 100644 --- a/src/gui/kernel/qplatformscreen.h +++ b/src/gui/kernel/qplatformscreen.h @@ -80,6 +80,8 @@ class Q_GUI_EXPORT QPlatformScreen Q_DECLARE_PRIVATE(QPlatformScreen) public: + Q_DISABLE_COPY_MOVE(QPlatformScreen) + enum SubpixelAntialiasingType { // copied from qfontengine_p.h since we can't include private headers Subpixel_None, Subpixel_RGB, @@ -164,8 +166,6 @@ protected: QScopedPointer d_ptr; private: - Q_DISABLE_COPY(QPlatformScreen) - friend class QScreenPrivate; }; diff --git a/src/gui/kernel/qplatformservices.h b/src/gui/kernel/qplatformservices.h index 339bbfde3f..5de96cfa7d 100644 --- a/src/gui/kernel/qplatformservices.h +++ b/src/gui/kernel/qplatformservices.h @@ -58,6 +58,8 @@ class QUrl; class Q_GUI_EXPORT QPlatformServices { public: + Q_DISABLE_COPY_MOVE(QPlatformServices) + QPlatformServices(); virtual ~QPlatformServices() { } diff --git a/src/gui/kernel/qplatformsessionmanager.h b/src/gui/kernel/qplatformsessionmanager.h index ca7cab389b..c6c3984816 100644 --- a/src/gui/kernel/qplatformsessionmanager.h +++ b/src/gui/kernel/qplatformsessionmanager.h @@ -64,6 +64,8 @@ QT_BEGIN_NAMESPACE class Q_GUI_EXPORT QPlatformSessionManager { public: + Q_DISABLE_COPY_MOVE(QPlatformSessionManager) + explicit QPlatformSessionManager(const QString &id, const QString &key); virtual ~QPlatformSessionManager(); @@ -101,8 +103,6 @@ private: QStringList m_restartCommand; QStringList m_discardCommand; QSessionManager::RestartHint m_restartHint; - - Q_DISABLE_COPY(QPlatformSessionManager) }; QT_END_NAMESPACE diff --git a/src/gui/kernel/qplatformsurface.h b/src/gui/kernel/qplatformsurface.h index 4d8854fb40..475f3ef330 100644 --- a/src/gui/kernel/qplatformsurface.h +++ b/src/gui/kernel/qplatformsurface.h @@ -65,6 +65,8 @@ class QDebug; class Q_GUI_EXPORT QPlatformSurface { public: + Q_DISABLE_COPY_MOVE(QPlatformSurface) + virtual ~QPlatformSurface(); virtual QSurfaceFormat format() const = 0; diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h index 1d6049a98d..54c8c70025 100644 --- a/src/gui/kernel/qplatformtheme.h +++ b/src/gui/kernel/qplatformtheme.h @@ -76,6 +76,8 @@ class Q_GUI_EXPORT QPlatformTheme { Q_DECLARE_PRIVATE(QPlatformTheme) public: + Q_DISABLE_COPY_MOVE(QPlatformTheme) + enum ThemeHint { CursorFlashTime, KeyboardInputInterval, @@ -324,8 +326,6 @@ public: protected: explicit QPlatformTheme(QPlatformThemePrivate *priv); QScopedPointer d_ptr; -private: - Q_DISABLE_COPY(QPlatformTheme) }; QT_END_NAMESPACE diff --git a/src/gui/kernel/qplatformwindow.h b/src/gui/kernel/qplatformwindow.h index 1590a10554..995ccad70e 100644 --- a/src/gui/kernel/qplatformwindow.h +++ b/src/gui/kernel/qplatformwindow.h @@ -71,6 +71,8 @@ class Q_GUI_EXPORT QPlatformWindow : public QPlatformSurface { Q_DECLARE_PRIVATE(QPlatformWindow) public: + Q_DISABLE_COPY_MOVE(QPlatformWindow) + explicit QPlatformWindow(QWindow *window); ~QPlatformWindow() override; @@ -164,8 +166,6 @@ protected: static QSize constrainWindowSize(const QSize &size); QScopedPointer d_ptr; -private: - Q_DISABLE_COPY(QPlatformWindow) }; QT_END_NAMESPACE -- cgit v1.2.3