realign the widget if it's resized

svn path=/trunk/KDE/kdelibs/; revision=1216378
This commit is contained in:
Marco Martin 2011-01-22 22:13:42 +00:00
parent dcd645696b
commit c158ebbaa4

View File

@ -1422,7 +1422,13 @@ bool ScrollWidget::eventFilter(QObject *watched, QEvent *event)
d->stopAnimations();
d->adjustScrollbarsTimer->start(200);
updateGeometry();
ensureItemVisible(d->widget.data());
if (d->widget.data()->size().width() < viewportGeometry().width() ||
d->widget.data()->size().height() < viewportGeometry().height()) {
d->widget.data()->setPos(d->minXExtent(),
d->minYExtent());
} else {
ensureItemVisible(d->widget.data());
}
} else if (watched == d->widget.data() && event->type() == QEvent::GraphicsSceneMove) {
d->horizontalScrollBar->blockSignals(true);
d->verticalScrollBar->blockSignals(true);