summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicslinearlayout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/graphicsview/qgraphicslinearlayout.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicslinearlayout.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gui/graphicsview/qgraphicslinearlayout.cpp b/src/gui/graphicsview/qgraphicslinearlayout.cpp
index 5591638395..1229379ee8 100644
--- a/src/gui/graphicsview/qgraphicslinearlayout.cpp
+++ b/src/gui/graphicsview/qgraphicslinearlayout.cpp
@@ -275,17 +275,16 @@ void QGraphicsLinearLayout::insertItem(int index, QGraphicsLayoutItem *item)
qWarning("QGraphicsLinearLayout::insertItem: cannot insert itself");
return;
}
- Q_ASSERT(item);
- //the order of the following instructions is very important because
- //invalidating the layout before adding the child item will make the layout happen
- //before we try to paint the item
- invalidate();
d->addChildLayoutItem(item);
d->fixIndex(&index);
d->engine.insertRow(index, d->orientation);
new QGridLayoutItem(&d->engine, item, d->gridRow(index), d->gridColumn(index), 1, 1, 0, index);
+ //the order of the following instructions is very important because
+ //invalidating the layout before adding the child item will make the layout happen
+ //before we try to paint the item
+ invalidate();
}
/*!