summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRym Bouabid <rym.bouabid@qt.io>2023-09-06 14:20:24 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-09-12 22:59:27 +0000
commitf45b0d08bffcf186cdd7c4372e2b2c1aa59f7a64 (patch)
treea4dcb97de9c19c0597fc4be1b807933fd23b859d
parent6258cbd45364de0ed2b797b4f6b98d9f9b085a4f (diff)
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 <dennis.oberst@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> (cherry picked from commit a4d7a4ccb39daa86ee2ef23b1408344822ae7c16) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit a88f26f7e4fad73d9f31e3b493091415d5f8a20d)
-rw-r--r--examples/corelib/threads/mandelbrot/main.cpp5
-rw-r--r--examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp1
-rw-r--r--examples/corelib/threads/mandelbrot/mandelbrotwidget.h7
-rw-r--r--examples/corelib/threads/mandelbrot/renderthread.cpp1
4 files changed, 7 insertions, 7 deletions
diff --git a/examples/corelib/threads/mandelbrot/main.cpp b/examples/corelib/threads/mandelbrot/main.cpp
index d0d4680978..6a24deec24 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 <QApplication>
-
-#include <QScreen>
-
#include <QCommandLineParser>
#include <QCommandLineOption>
#include <QDebug>
-#include <QRect>
//! [0]
int main(int argc, char *argv[])
diff --git a/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp b/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp
index e0f33a2b0b..ab555fe7df 100644
--- a/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp
+++ b/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp
@@ -4,6 +4,7 @@
#include "mandelbrotwidget.h"
#include <QGesture>
+#include <QGestureEvent>
#include <QKeyEvent>
#include <QPainter>
diff --git a/examples/corelib/threads/mandelbrot/mandelbrotwidget.h b/examples/corelib/threads/mandelbrot/mandelbrotwidget.h
index 23c3a2bf40..642feebdd8 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 <QGestureEvent>
+#include "renderthread.h"
+
#include <QPixmap>
#include <QWidget>
-#include "renderthread.h"
+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 9e6c884f91..7e4ff5ba8e 100644
--- a/examples/corelib/threads/mandelbrot/renderthread.cpp
+++ b/examples/corelib/threads/mandelbrot/renderthread.cpp
@@ -4,7 +4,6 @@
#include "renderthread.h"
#include <QImage>
-
#include <QElapsedTimer>
#include <QTextStream>