avoid unecessary updates, use d->size consistently so problem, if they arise, show up more consistently ;)

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=738038
This commit is contained in:
Aaron J. Seigo 2007-11-17 19:01:02 +00:00
parent e5dca92fdf
commit d9493e73ef
2 changed files with 4 additions and 5 deletions

View File

@ -83,6 +83,7 @@ void Layout::update()
{
setGeometry(geometry());
}
void Layout::invalidate()
{
// find and update the top level layout

View File

@ -216,7 +216,7 @@ void Widget::setGeometry(const QRectF& geometry)
d->size = QSizeF(width, height);
if (layout()) {
layout()->setGeometry(boundingRect());
layout()->setGeometry(QRectF(QPointF(0, 0), d->size));
}
if (managingLayout()) {
@ -296,16 +296,14 @@ void Widget::addChild(Widget *w)
d->childList.append(w);
w->setParentItem(this);
//kDebug() << "Added Child Widget" << w;
//kDebug() << "Added Child Widget" << (QObject*)w << "our geom is" << geometry();
if (layout()) {
layout()->addItem(w);
}
updateGeometry();
//TODO: is this necessary?
w->update();
//kDebug() << "after the item is added our geom is now" << geometry();
}
void Widget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)