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 /tests/auto/gui | |
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 'tests/auto/gui')
-rw-r--r-- | tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp | 2 | ||||
-rw-r--r-- | tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp b/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp index dda91225e5..d0203a6d3b 100644 --- a/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp +++ b/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp @@ -7,6 +7,8 @@ #include <qwindow.h> #include <QtGui/private/qpointingdevice_p.h> +#include <QtCore/qpointer.h> + Q_LOGGING_CATEGORY(lcTests, "qt.gui.tests") class MouseEventWidget : public QWindow diff --git a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp index be976adc5f..36254b17a9 100644 --- a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp +++ b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp @@ -20,6 +20,8 @@ #include <private/qguiapplication_p.h> #include <qpa/qplatformintegration.h> +#include <QtCore/qpointer.h> + Q_LOGGING_CATEGORY(lcTests, "qt.gui.tests") class tst_QTouchEventWidget : public QWidget |