diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-10-13 12:27:44 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2023-10-16 19:53:38 +0200 |
commit | a4caf162f0b93e994cf96d8b8e451b468c272fd1 (patch) | |
tree | e072769789a2b203f50e0d640ecc77e9ec535de3 /src | |
parent | 205ce7daac2ba690629a47b0a37822a937a5d7c2 (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: I7c18d8cfea4eb65eb7b518b03eedf3750dd45916
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/api/qwebenginepage.cpp | 2 | ||||
-rw-r--r-- | src/core/net/custom_url_loader_factory.cpp | 1 | ||||
-rw-r--r-- | src/webenginewidgets/api/qwebengineview_p.h | 2 |
3 files changed, 5 insertions, 0 deletions
diff --git a/src/core/api/qwebenginepage.cpp b/src/core/api/qwebenginepage.cpp index 7b0471e1b..815b4c40b 100644 --- a/src/core/api/qwebenginepage.cpp +++ b/src/core/api/qwebenginepage.cpp @@ -44,8 +44,10 @@ #include <QClipboard> #include <QKeyEvent> #include <QIcon> + #include <QLoggingCategory> #include <QMimeData> +#include <QtCore/QPointer> #include <QRect> #include <QTimer> #include <QUrl> diff --git a/src/core/net/custom_url_loader_factory.cpp b/src/core/net/custom_url_loader_factory.cpp index 5ad02ebc3..4274def99 100644 --- a/src/core/net/custom_url_loader_factory.cpp +++ b/src/core/net/custom_url_loader_factory.cpp @@ -32,6 +32,7 @@ #include <QtCore/qiodevice.h> #include <QtCore/qmimedatabase.h> #include <QtCore/qmimedata.h> +#include <QtCore/qpointer.h> #include <QtCore/qurl.h> namespace QtWebEngineCore { diff --git a/src/webenginewidgets/api/qwebengineview_p.h b/src/webenginewidgets/api/qwebengineview_p.h index 7c0f3fe60..43cc6fe81 100644 --- a/src/webenginewidgets/api/qwebengineview_p.h +++ b/src/webenginewidgets/api/qwebengineview_p.h @@ -19,6 +19,8 @@ #include "render_view_context_menu_qt.h" +#include <QtCore/qpointer.h> + namespace QtWebEngineCore { class AutofillPopupController; class QWebEngineContextMenuRequest; |