From aa9529408041ab16bb920840d78b3f41c759a2f8 Mon Sep 17 00:00:00 2001 From: Rym Bouabid Date: Wed, 20 Sep 2023 17:44:57 +0200 Subject: [PATCH] Revamp Queued Custom Type Ex: Fix includes Fix includes order and add the needed ones to avoid transitive includes. Remove QT_{BEGIN,END}_NAMESPACE because these are private Qt macros that should not be used in the examples. Task-number: QTBUG-117147 Pick-to: 6.6 6.5 Change-Id: I6caa0a59f2ab4dfec6fb558a0896c27b05b6a5db Reviewed-by: Ivan Solovev --- examples/corelib/threads/queuedcustomtype/main.cpp | 11 ++++++++--- .../corelib/threads/queuedcustomtype/renderthread.cpp | 2 ++ .../corelib/threads/queuedcustomtype/renderthread.h | 3 ++- examples/corelib/threads/queuedcustomtype/window.cpp | 11 ++++++++++- examples/corelib/threads/queuedcustomtype/window.h | 11 ++++++----- 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/examples/corelib/threads/queuedcustomtype/main.cpp b/examples/corelib/threads/queuedcustomtype/main.cpp index 0cf019990a..28e7687f02 100644 --- a/examples/corelib/threads/queuedcustomtype/main.cpp +++ b/examples/corelib/threads/queuedcustomtype/main.cpp @@ -1,12 +1,17 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -#include -#include -#include #include "block.h" #include "window.h" +#include +#include +#include +#include +#include +#include +#include + QImage createImage(int width, int height) { QImage image(width, height, QImage::Format_RGB16); diff --git a/examples/corelib/threads/queuedcustomtype/renderthread.cpp b/examples/corelib/threads/queuedcustomtype/renderthread.cpp index d7b2172608..deb518e2b1 100644 --- a/examples/corelib/threads/queuedcustomtype/renderthread.cpp +++ b/examples/corelib/threads/queuedcustomtype/renderthread.cpp @@ -1,9 +1,11 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +#include "block.h" #include "renderthread.h" #include +#include RenderThread::RenderThread(QObject *parent) : QThread(parent) diff --git a/examples/corelib/threads/queuedcustomtype/renderthread.h b/examples/corelib/threads/queuedcustomtype/renderthread.h index afbc70ec75..2946f1ee33 100644 --- a/examples/corelib/threads/queuedcustomtype/renderthread.h +++ b/examples/corelib/threads/queuedcustomtype/renderthread.h @@ -7,7 +7,8 @@ #include #include #include -#include "block.h" + +class Block; //! [RenderThread class definition] class RenderThread : public QThread diff --git a/examples/corelib/threads/queuedcustomtype/window.cpp b/examples/corelib/threads/queuedcustomtype/window.cpp index 1adfe7ed38..a91b2e6b8d 100644 --- a/examples/corelib/threads/queuedcustomtype/window.cpp +++ b/examples/corelib/threads/queuedcustomtype/window.cpp @@ -1,8 +1,17 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +#include "block.h" +#include "renderthread.h" #include "window.h" -#include + +#include +#include +#include +#include +#include +#include +#include //! [Window constructor start] Window::Window(QWidget *parent) diff --git a/examples/corelib/threads/queuedcustomtype/window.h b/examples/corelib/threads/queuedcustomtype/window.h index b1ab4f6c24..a4f995696e 100644 --- a/examples/corelib/threads/queuedcustomtype/window.h +++ b/examples/corelib/threads/queuedcustomtype/window.h @@ -4,13 +4,14 @@ #ifndef WINDOW_H #define WINDOW_H +#include +#include +#include +#include #include -#include "renderthread.h" -QT_BEGIN_NAMESPACE -class QLabel; -class QPushButton; -QT_END_NAMESPACE +class Block; +class RenderThread; //! [Window class definition] class Window : public QWidget