Repaint the widget on request. Among other things now the scroll works well.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=832013
This commit is contained in:
parent
a1ff7b38f4
commit
b828a0efd4
@ -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
|
||||
|
@ -30,6 +30,7 @@ class QKeyEvent;
|
||||
class QGraphicsSceneDragDropEvent;
|
||||
class QGraphicsSceneMouseEvent;
|
||||
class QGraphicsSceneWheelEvent;
|
||||
class QRect;
|
||||
|
||||
namespace Plasma
|
||||
{
|
||||
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user