diff options
author | A-Team <ateam@pad.test.qt.nokia.com> | 2010-10-04 22:00:19 (GMT) |
---|---|---|
committer | A-Team <ateam@pad.test.qt.nokia.com> | 2010-10-04 22:00:19 (GMT) |
commit | e3bcf44684aa30271c986911b328c9d9c372912a (patch) | |
tree | de7f835e6fe69b610e64397a768f1630fb8b5c54 /src/gui/graphicsview/qgraphicslinearlayout.cpp | |
parent | f3817bc1a7bc3df360af9116dfd96f3181816472 (diff) | |
parent | a7bf1cfb1a75c35e837c01f4a5b0697fc8961148 (diff) | |
download | Qt-e3bcf44684aa30271c986911b328c9d9c372912a.zip Qt-e3bcf44684aa30271c986911b328c9d9c372912a.tar.gz Qt-e3bcf44684aa30271c986911b328c9d9c372912a.tar.bz2 |
Merge branch '4.7-upstream' into 4.7-doc
Diffstat (limited to 'src/gui/graphicsview/qgraphicslinearlayout.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicslinearlayout.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicslinearlayout.cpp b/src/gui/graphicsview/qgraphicslinearlayout.cpp index 1588364..7e8d19f 100644 --- a/src/gui/graphicsview/qgraphicslinearlayout.cpp +++ b/src/gui/graphicsview/qgraphicslinearlayout.cpp @@ -275,13 +275,17 @@ 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); - Q_ASSERT(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); - invalidate(); } /*! |