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()); setGeometry(geometry());
} }
void Layout::invalidate() void Layout::invalidate()
{ {
// find and update the top level layout // find and update the top level layout

View File

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