diff --git a/widgets/webview.cpp b/widgets/webview.cpp index bca86c35c..35b854b41 100644 --- a/widgets/webview.cpp +++ b/widgets/webview.cpp @@ -50,6 +50,7 @@ public: void loadingFinished(bool success); void dragTimeoutExpired(); + void delayedViewSync(); WebView *q; AnimableGraphicsWebView *webView; @@ -263,7 +264,7 @@ QVariant WebView::itemChange(GraphicsItemChange change, const QVariant &value) //FIXME: QWebPage _requires_ a QWidget view to not crash in places such as // WebCore::PopupMenu::show() due to hostWindow()->platformPageClient() == NULL // because QWebPage::d->client is NULL - d->webView->page()->setView(viewFor(this)); + QTimer::singleShot(0, this, SLOT(delayedViewSync())); } return QGraphicsWidget::itemChange(change, value); } @@ -291,6 +292,11 @@ void WebViewPrivate::loadingFinished(bool success) q->update(); } +void WebViewPrivate::delayedViewSync() +{ + webView->page()->setView(viewFor(q)); +} + } // namespace Plasma #include "webview.moc" diff --git a/widgets/webview.h b/widgets/webview.h index 293330390..547e9fbb6 100644 --- a/widgets/webview.h +++ b/widgets/webview.h @@ -216,6 +216,7 @@ class PLASMA_EXPORT WebView : public QGraphicsWidget private: Q_PRIVATE_SLOT(d, void loadingFinished(bool success)) + Q_PRIVATE_SLOT(d, void delayedViewSync()) WebViewPrivate * const d; friend class WebViewPrivate;