correctly resize the graphicswidget when the dialog corners are dragged

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=869267
This commit is contained in:
Marco Martin 2008-10-08 16:47:29 +00:00
parent 57d1f48145
commit 1a196323d2

View File

@ -283,7 +283,16 @@ void Dialog::resizeEvent(QResizeEvent *e)
setMask(d->background->mask());
if (d->resizeStartCorner != Dialog::NoCorner && d->view && d->widget) {
d->widget->resize(d->view->size());
d->widget->setPreferredSize(d->view->size());
QGraphicsLayoutItem *layout = d->widget->parentLayoutItem();
QGraphicsWidget *parentWidget = d->widget->parentWidget();
if (layout && parentWidget) {
layout->updateGeometry();
parentWidget->resize(layout->preferredSize());
}
d->view->setSceneRect(d->widget->mapToScene(d->widget->boundingRect()).boundingRect());
d->view->centerOn(d->widget);
}