diff --git a/widgets/webcontent.cpp b/widgets/webcontent.cpp index 37dd2a88c..0791d3a05 100644 --- a/widgets/webcontent.cpp +++ b/widgets/webcontent.cpp @@ -43,6 +43,7 @@ public: } void loadingFinished(bool success); + void updateRequested(const QRect& dirtyRect); WebContent *q; QWebPage *page; @@ -111,6 +112,7 @@ void WebContent::setPage(QWebPage *page) if (d->page) { connect(d->page, SIGNAL(loadProgress(int)), this, SIGNAL(loadProgress(int))); connect(d->page, SIGNAL(loadFinished(bool)), this, SLOT(loadingFinished(bool))); + connect(d->page, SIGNAL(repaintRequested(const QRect&)), this, SLOT(updateRequested(const QRect&))); } } @@ -349,6 +351,14 @@ void WebContentPrivate::loadingFinished(bool success) { loaded = success; emit q->loadFinished(success); + q->update(); +} + +void WebContentPrivate::updateRequested(const QRect& dirtyRect) +{ + if (loaded && page) { + q->update(QRectF(dirtyRect.topLeft().x(), dirtyRect.topLeft().y(), dirtyRect.width(), dirtyRect.height())); + } } } // namespace Plasma diff --git a/widgets/webcontent.h b/widgets/webcontent.h index 33861ed0e..943b16c3c 100644 --- a/widgets/webcontent.h +++ b/widgets/webcontent.h @@ -30,6 +30,7 @@ class QKeyEvent; class QGraphicsSceneDragDropEvent; class QGraphicsSceneMouseEvent; class QGraphicsSceneWheelEvent; +class QRect; namespace Plasma { @@ -97,7 +98,7 @@ class PLASMA_EXPORT WebContent : public QGraphicsWidget /** * Reimplementation */ - void setGeometry(const QRectF &geometry); + void setGeometry(const QRectF &geometry); Q_SIGNALS: /** @@ -138,6 +139,7 @@ class PLASMA_EXPORT WebContent : public QGraphicsWidget private: Q_PRIVATE_SLOT(d, void loadingFinished(bool success)) + Q_PRIVATE_SLOT(d, void updateRequested(const QRect& dirtyRect)) WebContentPrivate * const d; friend class WebContentPrivate;