delay syze sync a bit

fixes things when two operations are done subsequent, like removing a normal widget and set a qgraphicswidget

svn path=/trunk/KDE/kdelibs/; revision=1122864
This commit is contained in:
Marco Martin 2010-05-04 21:30:52 +00:00
parent e56ec546f3
commit 62f2eb46f1

View File

@ -102,6 +102,7 @@ public:
int resizeStartCorner;
QTimer *moveTimer;
QTimer *adjustViewTimer;
QTimer *adjustSizeTimer;
QSize oldGraphicsWidgetMinimumSize;
QSize oldGraphicsWidgetMaximumSize;
Plasma::AspectRatioMode aspectRatioMode;
@ -410,6 +411,10 @@ Dialog::Dialog(QWidget *parent, Qt::WindowFlags f)
d->adjustViewTimer->setSingleShot(true);
connect(d->adjustViewTimer, SIGNAL(timeout()), this, SLOT(syncToGraphicsWidget()));
d->adjustSizeTimer = new QTimer(this);
d->adjustSizeTimer->setSingleShot(true);
connect(d->adjustSizeTimer, SIGNAL(timeout()), this, SLOT(adjustSize()));
connect(d->background, SIGNAL(repaintNeeded()), this, SLOT(update()));
connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), this, SLOT(themeChanged()));
@ -654,7 +659,7 @@ void Dialog::setGraphicsWidget(QGraphicsWidget *widget)
d->view->setScene(widget->scene());
syncToGraphicsWidget();
adjustSize();
d->adjustSizeTimer->start(150);
widget->installEventFilter(this);
d->view->installEventFilter(this);