diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-10-05 17:26:25 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2023-10-12 21:38:54 +0200 |
commit | 4a7c76d4a5365343178ea29c8a8e9b8d8acb89b5 (patch) | |
tree | 56c914e0c8892b494ea645d5b51410385140fef8 /src/gui/kernel | |
parent | 0b6d2d9187f87bb24c75f6d171f43677e0845201 (diff) |
Include what you need: <QPointer>
All these TUs relied on transitive includes of qpointer.h, maybe to a
large extent via qevent.h, though, given that qevent.h is more or less
the only public QtBase header that includes qpointer.h, something else
seems to be at play here.
Said qevent.h actually needs QPointer in-name-only, so a forward
declaration would suffice. Prepare for qevent.h dropping the include.
The algorithm I used was:
If the TU mentions 'passiveGrabbers', the name of the QEvent function
that returns QPointers, and the TU doesn't have qpointer.h included
explicitly, include it. That may produce False Positives, but better
safe than sorry. Otherwise, in src/, add an include to all source and
header files which mention QPointer. Exception: if foo.h of a foo.cpp
already includes it, don't include again.
Task-number: QTBUG-117670
Change-Id: I3321cccdb41ce0ba6d8a709cea92427aba398254
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qaction_p.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qactiongroup_p.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qdnd_p.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qdrag.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qevent.cpp | 3 | ||||
-rw-r--r-- | src/gui/kernel/qeventpoint_p.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qguiapplication_p.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qpointingdevice_p.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qwindow_p.h | 2 |
9 files changed, 19 insertions, 0 deletions
diff --git a/src/gui/kernel/qaction_p.h b/src/gui/kernel/qaction_p.h index 8aa75fdf89..e79cc26b4d 100644 --- a/src/gui/kernel/qaction_p.h +++ b/src/gui/kernel/qaction_p.h @@ -21,6 +21,8 @@ #if QT_CONFIG(shortcut) # include <QtGui/private/qshortcutmap_p.h> #endif + +#include <QtCore/qpointer.h> #include "private/qobject_p.h" QT_REQUIRE_CONFIG(action); diff --git a/src/gui/kernel/qactiongroup_p.h b/src/gui/kernel/qactiongroup_p.h index c7a058a6f2..ba939a2b10 100644 --- a/src/gui/kernel/qactiongroup_p.h +++ b/src/gui/kernel/qactiongroup_p.h @@ -21,6 +21,8 @@ #if QT_CONFIG(shortcut) # include <QtGui/private/qshortcutmap_p.h> #endif + +#include <QtCore/qpointer.h> #include "private/qobject_p.h" QT_REQUIRE_CONFIG(action); diff --git a/src/gui/kernel/qdnd_p.h b/src/gui/kernel/qdnd_p.h index c863a63620..b5a2e015f4 100644 --- a/src/gui/kernel/qdnd_p.h +++ b/src/gui/kernel/qdnd_p.h @@ -27,6 +27,8 @@ #include "private/qobject_p.h" #include "QtGui/qbackingstore.h" +#include <QtCore/qpointer.h> + QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE diff --git a/src/gui/kernel/qdrag.cpp b/src/gui/kernel/qdrag.cpp index 0f707e2dd6..4e707e4915 100644 --- a/src/gui/kernel/qdrag.cpp +++ b/src/gui/kernel/qdrag.cpp @@ -9,6 +9,8 @@ #include <qpoint.h> #include "qdnd_p.h" +#include <QtCore/qpointer.h> + QT_BEGIN_NAMESPACE /*! diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index f39467cc0f..b5727956ae 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qevent.h" + #include "qcursor.h" #include "private/qguiapplication_p.h" #include "private/qinputdevice_p.h" @@ -9,6 +10,7 @@ #include "qpa/qplatformintegration.h" #include "private/qevent_p.h" #include "private/qeventpoint_p.h" + #include "qfile.h" #include "qhashfunctions.h" #include "qmetaobject.h" @@ -16,6 +18,7 @@ #include "qevent_p.h" #include "qmath.h" #include "qloggingcategory.h" +#include "qpointer.h" #if QT_CONFIG(draganddrop) #include <qpa/qplatformdrag.h> diff --git a/src/gui/kernel/qeventpoint_p.h b/src/gui/kernel/qeventpoint_p.h index f70c285e3e..c339c7e3e1 100644 --- a/src/gui/kernel/qeventpoint_p.h +++ b/src/gui/kernel/qeventpoint_p.h @@ -17,7 +17,9 @@ #include <QtGui/private/qtguiglobal_p.h> #include <QtGui/qevent.h> + #include <QtCore/qloggingcategory.h> +#include <QtCore/qpointer.h> QT_BEGIN_NAMESPACE diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h index c96cbdd01f..5d257b1fc7 100644 --- a/src/gui/kernel/qguiapplication_p.h +++ b/src/gui/kernel/qguiapplication_p.h @@ -34,6 +34,8 @@ # include "private/qshortcutmap_p.h" #endif +#include <QtCore/qpointer.h> + #include <memory> QT_BEGIN_NAMESPACE diff --git a/src/gui/kernel/qpointingdevice_p.h b/src/gui/kernel/qpointingdevice_p.h index 403a54dc4f..b2f0574e9b 100644 --- a/src/gui/kernel/qpointingdevice_p.h +++ b/src/gui/kernel/qpointingdevice_p.h @@ -20,6 +20,8 @@ #include <QtGui/qpointingdevice.h> #include <QtGui/private/qtguiglobal_p.h> #include <QtGui/private/qinputdevice_p.h> + +#include <QtCore/qpointer.h> #include <QtCore/private/qflatmap_p.h> QT_BEGIN_NAMESPACE diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h index 7b1aad4838..5de3546392 100644 --- a/src/gui/kernel/qwindow_p.h +++ b/src/gui/kernel/qwindow_p.h @@ -26,6 +26,8 @@ #include <QtGui/qicon.h> #include <QtGui/qpalette.h> +#include <QtCore/qpointer.h> + QT_BEGIN_NAMESPACE class Q_GUI_EXPORT QWindowPrivate : public QObjectPrivate |