From f45b0d08bffcf186cdd7c4372e2b2c1aa59f7a64 Mon Sep 17 00:00:00 2001 From: Rym Bouabid Date: Wed, 6 Sep 2023 14:20:24 +0200 Subject: [PATCH] Revamp Mandelbrot example: Fix Includes Reorder the includes following the coding conventions. Remove unneeded includes. Add needed includes to avoid Transitive includes. QGestureEvent is passed by a pointer in the gestureEvent method in mandelbrotwidget.h. So, we do not really need to include the header. Instead, forward-declare QGestureEvent class in a namespace. Task-number: QTBUG-108861 Change-Id: I48cfd663bf98350281ef7f31e6c0ef3e301a08ca Reviewed-by: Dennis Oberst Reviewed-by: Ivan Solovev (cherry picked from commit a4d7a4ccb39daa86ee2ef23b1408344822ae7c16) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit a88f26f7e4fad73d9f31e3b493091415d5f8a20d) --- examples/corelib/threads/mandelbrot/main.cpp | 5 +---- examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp | 1 + examples/corelib/threads/mandelbrot/mandelbrotwidget.h | 9 ++++++--- examples/corelib/threads/mandelbrot/renderthread.cpp | 1 - 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/corelib/threads/mandelbrot/main.cpp b/examples/corelib/threads/mandelbrot/main.cpp index d0d46809789..6a24deec241 100644 --- a/examples/corelib/threads/mandelbrot/main.cpp +++ b/examples/corelib/threads/mandelbrot/main.cpp @@ -2,15 +2,12 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #include "mandelbrotwidget.h" +#include "renderthread.h" #include - -#include - #include #include #include -#include //! [0] int main(int argc, char *argv[]) diff --git a/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp b/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp index e0f33a2b0b1..ab555fe7dfd 100644 --- a/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp +++ b/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp @@ -4,6 +4,7 @@ #include "mandelbrotwidget.h" #include +#include #include #include diff --git a/examples/corelib/threads/mandelbrot/mandelbrotwidget.h b/examples/corelib/threads/mandelbrot/mandelbrotwidget.h index 23c3a2bf409..642feebdd83 100644 --- a/examples/corelib/threads/mandelbrot/mandelbrotwidget.h +++ b/examples/corelib/threads/mandelbrot/mandelbrotwidget.h @@ -4,11 +4,14 @@ #ifndef MANDELBROTWIDGET_H #define MANDELBROTWIDGET_H -#include -#include -#include #include "renderthread.h" +#include +#include + +QT_BEGIN_NAMESPACE +class QGestureEvent; +QT_END_NAMESPACE //! [0] class MandelbrotWidget : public QWidget diff --git a/examples/corelib/threads/mandelbrot/renderthread.cpp b/examples/corelib/threads/mandelbrot/renderthread.cpp index 9e6c884f91d..7e4ff5ba8e5 100644 --- a/examples/corelib/threads/mandelbrot/renderthread.cpp +++ b/examples/corelib/threads/mandelbrot/renderthread.cpp @@ -4,7 +4,6 @@ #include "renderthread.h" #include - #include #include