From bd1a648215272deb830ddea58e0dfa55e192f7ef Mon Sep 17 00:00:00 2001 From: Rob Scheepmaker Date: Sun, 30 Nov 2008 16:16:25 +0000 Subject: [PATCH] Removed some unnecesarry calls to adjustSizeHints() svn path=/trunk/KDE/kdelibs/; revision=890899 --- extender.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/extender.cpp b/extender.cpp index efe9ce84e..ecbde94b9 100644 --- a/extender.cpp +++ b/extender.cpp @@ -160,7 +160,7 @@ void Extender::saveState() QVariant Extender::itemChange(GraphicsItemChange change, const QVariant &value) { if (change == QGraphicsItem::ItemPositionHasChanged) { - d->adjustSizeHints(); + emit geometryChanged(); } return QGraphicsWidget::itemChange(change, value); @@ -186,7 +186,12 @@ void Extender::itemAddedEvent(ExtenderItem *item, const QPointF &pos) //remove the empty extender message if needed. d->updateEmptyExtenderLabel(); - d->adjustSizeHints(); + //if the item doesn't got a widget one will be set real soon, causing it's sizehints to + //change. Don't adjust the size hints in that case, since that spares us a call to + //adjustSizeHints() + if (item->widget()) { + d->adjustSizeHints(); + } } void Extender::itemRemovedEvent(ExtenderItem *item) @@ -402,8 +407,6 @@ void ExtenderPrivate::loadExtenderItems() cg.deleteGroup(pair.second); } } - - adjustSizeHints(); } void ExtenderPrivate::updateBorders()