diff --git a/layouts/boxlayout.cpp b/layouts/boxlayout.cpp index cd392b4e6..6d4f5b506 100644 --- a/layouts/boxlayout.cpp +++ b/layouts/boxlayout.cpp @@ -309,7 +309,6 @@ void BoxLayout::insertItem(int index, LayoutItem *item) } updateGeometry(); - startAnimation(); } void BoxLayout::addItem(LayoutItem *item) @@ -335,7 +334,6 @@ void BoxLayout::removeItem(LayoutItem *item) } updateGeometry(); - startAnimation(); } int BoxLayout::indexOf(LayoutItem *l) const @@ -359,8 +357,7 @@ LayoutItem *BoxLayout::takeAt(int i) } return d->children.takeAt(i); - // FIXME: This is never reached. Should it be called? Should - // startAnimation() also be called? + // FIXME: This is never reached. Should it be called? updateGeometry(); } @@ -446,6 +443,8 @@ void BoxLayout::relayout() pos = d->layoutItem(margined, d->children[i], pos , sizes[i]); } + + startAnimation(); } diff --git a/layouts/flowlayout.cpp b/layouts/flowlayout.cpp index a08c95d04..56298fec1 100644 --- a/layouts/flowlayout.cpp +++ b/layouts/flowlayout.cpp @@ -69,7 +69,6 @@ void FlowLayout::addItem(LayoutItem* item) } updateGeometry(); - startAnimation(); } void FlowLayout::removeItem(LayoutItem* item) { @@ -85,7 +84,6 @@ void FlowLayout::removeItem(LayoutItem* item) } updateGeometry(); - startAnimation(); } int FlowLayout::indexOf(LayoutItem* item) const { @@ -124,7 +122,7 @@ LayoutItem* FlowLayout::takeAt(int i) } return d->items.takeAt(i); - // FIXME: Should updateGeometry() and startAnimation() be called? + // FIXME: Should updateGeometry() be called? } template @@ -221,6 +219,8 @@ void FlowLayout::relayout() else item->setGeometry( newGeometry ); } + + startAnimation(); } Qt::Orientations FlowLayout::expandingDirections() const diff --git a/layouts/layout.cpp b/layouts/layout.cpp index 9e2c727ad..5d27937d3 100644 --- a/layouts/layout.cpp +++ b/layouts/layout.cpp @@ -225,8 +225,8 @@ QSizeF Layout::maximumSize() const void Layout::startAnimation() { if (animator() && animator()->timeLine()) { - animator()->timeLine()->setCurrentTime(0); if (animator()->timeLine()->state() == QTimeLine::NotRunning) { + animator()->timeLine()->setCurrentTime(0); animator()->timeLine()->start(); } }