diff options
author | Jüri Valdmann <juri.valdmann@qt.io> | 2019-02-18 16:10:17 +0100 |
---|---|---|
committer | Jüri Valdmann <juri.valdmann@qt.io> | 2019-02-25 09:13:59 +0000 |
commit | 1f77d4709946511b919810354f19875824399096 (patch) | |
tree | 1fc4ff1f0df40afb0a9dbf340994c80ee178918f /src/core/web_engine_settings.h | |
parent | 837347e1901086a9757b5aca7e5bbee7b0d8e20e (diff) |
Fix crash on dynamic_cast in global event filter
Installing an event filter on QApplication which uses dynamic_cast will crash
the application since QtWebEngine is sending QTimerEvents to classes without
RTTI information.
Fix by
1. Moving the QObject part of MessagePumpForUIQt into api/ as a private class.
2. Using QTimer directly in WebEngineSettings, without subclassing.
Fixes: QTBUG-73833
Change-Id: Ida73006a4fef76637c964f8f05468adcc4a190ce
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_engine_settings.h')
-rw-r--r-- | src/core/web_engine_settings.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/core/web_engine_settings.h b/src/core/web_engine_settings.h index 06a7a6004..8930d7c27 100644 --- a/src/core/web_engine_settings.h +++ b/src/core/web_engine_settings.h @@ -57,6 +57,7 @@ #include <QHash> #include <QUrl> #include <QSet> +#include <QTimer> namespace content { struct RendererPreferences; @@ -65,7 +66,6 @@ struct WebPreferences; } namespace QtWebEngineCore { -class BatchTimer; class WebContentsAdapter; class QWEBENGINECORE_PRIVATE_EXPORT WebEngineSettings { @@ -177,7 +177,7 @@ private: QHash<FontSize, int> m_fontSizes; QString m_defaultEncoding; QScopedPointer<content::WebPreferences> webPreferences; - QScopedPointer<BatchTimer> m_batchTimer; + QTimer m_batchTimer; WebEngineSettings *parentSettings; QSet<WebEngineSettings *> childSettings; @@ -187,7 +187,6 @@ private: static QHash<FontSize, int> s_defaultFontSizes; UnknownUrlSchemePolicy m_unknownUrlSchemePolicy; - friend class BatchTimer; friend class WebContentsAdapter; }; |