new signal: viewportGeometrychanged

svn path=/trunk/KDE/kdelibs/; revision=1116489
This commit is contained in:
Marco Martin 2010-04-19 15:55:04 +00:00
parent 8fda976c9e
commit 215e883684
2 changed files with 15 additions and 1 deletions

View File

@ -1293,7 +1293,10 @@ bool ScrollWidget::eventFilter(QObject *watched, QEvent *event)
return false;
}
if (watched == d->widget.data() && event->type() == QEvent::GraphicsSceneResize) {
if (watched == d->scrollingWidget && (event->type() == QEvent::GraphicsSceneResize ||
event->type() == QEvent::Move)) {
emit viewportGeometryChanged(viewportGeometry());
} else if (watched == d->widget.data() && event->type() == QEvent::GraphicsSceneResize) {
d->adjustScrollbarsTimer->start(200);
updateGeometry();
} else if (watched == d->widget.data() && event->type() == QEvent::GraphicsSceneMove) {

View File

@ -234,9 +234,20 @@ public:
QWidget *nativeWidget() const;
Q_SIGNALS:
/**
* The widget started or stopped an animated scroll
* @since 4.4
*/
void scrollStateChanged(QAbstractAnimation::State newState,
QAbstractAnimation::State oldState);
/**
* The viewport geomety changed, for instance due a widget resize
*
* @since 4.5
*/
void viewportGeometryChanged(const QRectF &geomety);
protected:
void resizeEvent(QGraphicsSceneResizeEvent *event);