force a valid rect in adjustview, otherwise the view will get the whole

scene O.o
(this fixes the tooltips not moving issue)

svn path=/trunk/KDE/kdelibs/; revision=888074
This commit is contained in:
Marco Martin 2008-11-23 17:55:01 +00:00
parent e06cb3cda0
commit c0d430de74

View File

@ -151,8 +151,14 @@ void DialogPrivate::adjustView()
q->updateGeometry();
//reposition and resize the view.
view->setSceneRect(widget->sceneBoundingRect());
view->resize(view->mapFromScene(view->sceneRect()).boundingRect().size());
//force a valid rect, otherwise it will take up the whole scene
QRectF sceneRect(widget->sceneBoundingRect());
sceneRect.setWidth(qMax(qreal(1), sceneRect.width()));
sceneRect.setHeight(qMax(qreal(1), sceneRect.height()));
view->setSceneRect(sceneRect);
view->resize(widget->size().toSize());
view->centerOn(widget);
if (q->size() != prevSize) {