setting the size hints before changing the views sceneRect fixes the bug where reordering items within an extender resizes the dialog to a size that is too small.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=876611
This commit is contained in:
Rob Scheepmaker 2008-10-27 17:02:43 +00:00
parent 0cc762d4a0
commit eb62f23c04

View File

@ -138,14 +138,6 @@ void DialogPrivate::adjustView()
<< "| Widget maxsize hint:" << widget->maximumSize()
<< "| Widget bounding rect:" << widget->boundingRect();
QRectF boundingRect = widget->boundingRect();
boundingRect.setSize(widget->effectiveSizeHint(Qt::PreferredSize));
//reposition and resize the view.
view->setSceneRect(widget->sceneBoundingRect());
view->resize(view->mapFromScene(view->sceneRect()).boundingRect().size());
view->centerOn(widget);
//set the sizehints correctly:
int left, top, right, bottom;
q->getContentsMargins(&left, &top, &right, &bottom);
@ -158,6 +150,11 @@ void DialogPrivate::adjustView()
qMin(int(view->size().height()) + top + bottom, QWIDGETSIZE_MAX));
q->updateGeometry();
//reposition and resize the view.
view->setSceneRect(widget->sceneBoundingRect());
view->resize(view->mapFromScene(view->sceneRect()).boundingRect().size());
view->centerOn(widget);
if (q->size() != prevSize) {
//the size of the dialog has changed, emit the signal:
emit q->dialogResized();