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:
parent
0cc762d4a0
commit
eb62f23c04
13
dialog.cpp
13
dialog.cpp
@ -138,14 +138,6 @@ void DialogPrivate::adjustView()
|
|||||||
<< "| Widget maxsize hint:" << widget->maximumSize()
|
<< "| Widget maxsize hint:" << widget->maximumSize()
|
||||||
<< "| Widget bounding rect:" << widget->boundingRect();
|
<< "| 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:
|
//set the sizehints correctly:
|
||||||
int left, top, right, bottom;
|
int left, top, right, bottom;
|
||||||
q->getContentsMargins(&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));
|
qMin(int(view->size().height()) + top + bottom, QWIDGETSIZE_MAX));
|
||||||
q->updateGeometry();
|
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) {
|
if (q->size() != prevSize) {
|
||||||
//the size of the dialog has changed, emit the signal:
|
//the size of the dialog has changed, emit the signal:
|
||||||
emit q->dialogResized();
|
emit q->dialogResized();
|
||||||
|
Loading…
Reference in New Issue
Block a user