summaryrefslogtreecommitdiffstats
path: root/src/plugins/qwebengineview/qwebengineview_plugin.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2016-08-16 16:55:24 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2016-08-31 08:09:14 +0000
commit44f41d30ed3efce2f1970dcd158555b41b38014d (patch)
tree6fb144376b6488c55ff404f2df671666fc7d6afa /src/plugins/qwebengineview/qwebengineview_plugin.cpp
parent2209add7a5b019afef7830d8bbf416fbb2a2ecf5 (diff)
Qt Designer plugin: Add a dummy class for querying properties
Add a lightweight "fake" QWebEngineView class that is returned when Qt Designer queries the default property values by calling QDesignerCustomWidgetInterface::createWidget() with 0 parent, preventing crashes during QWebEngine initialization. Task-number: QTBUG-53984 Change-Id: Iced64b7d8af4c958fe7e29fa2f64bb9b681fbab2 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'src/plugins/qwebengineview/qwebengineview_plugin.cpp')
-rw-r--r--src/plugins/qwebengineview/qwebengineview_plugin.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/qwebengineview/qwebengineview_plugin.cpp b/src/plugins/qwebengineview/qwebengineview_plugin.cpp
index 2d331571..c885816c 100644
--- a/src/plugins/qwebengineview/qwebengineview_plugin.cpp
+++ b/src/plugins/qwebengineview/qwebengineview_plugin.cpp
@@ -91,7 +91,9 @@ bool QWebEngineViewPlugin::isContainer() const
QWidget *QWebEngineViewPlugin::createWidget(QWidget *parent)
{
- return new QWebEngineView(parent);
+ if (parent)
+ return new QWebEngineView(parent);
+ return new fake::QWebEngineView;
}
bool QWebEngineViewPlugin::isInitialized() const