From e258b7345c77f63a6f3f2e2c3bcd89245154203f Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 13 Oct 2023 12:26:25 +0200 Subject: [PATCH] Include what you need: 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: I8eb00fbd2df16300b0cbfc4157612a45c72ac12c Reviewed-by: Fabian Kosmale --- src/plugins/platforms/wayland/qwaylandwindow_p.h | 2 ++ tests/auto/wayland/shared/coreprotocol.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/plugins/platforms/wayland/qwaylandwindow_p.h b/src/plugins/platforms/wayland/qwaylandwindow_p.h index 5e064a642f3..7e0d3c57cdb 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow_p.h +++ b/src/plugins/platforms/wayland/qwaylandwindow_p.h @@ -35,6 +35,8 @@ #include #include +#include + struct wl_egl_window; QT_BEGIN_NAMESPACE diff --git a/tests/auto/wayland/shared/coreprotocol.h b/tests/auto/wayland/shared/coreprotocol.h index 20a3f2122b5..15ade2bcadb 100644 --- a/tests/auto/wayland/shared/coreprotocol.h +++ b/tests/auto/wayland/shared/coreprotocol.h @@ -6,6 +6,8 @@ #include "corecompositor.h" +#include + #include namespace MockCompositor {