diff options
author | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-04-06 12:13:39 (GMT) |
---|---|---|
committer | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-04-06 12:14:52 (GMT) |
commit | cf42b485ebc1ab3e1f0a804b8c4e404fa99f1f6f (patch) | |
tree | 8f61ec20451aed2ea8223e32bc50862e1e2ca8ba /examples/graphicsview/flowlayout/flowlayout.cpp | |
parent | 6d1ba5590c99ad92de75ecd8bc9921921123d809 (diff) | |
download | Qt-cf42b485ebc1ab3e1f0a804b8c4e404fa99f1f6f.zip Qt-cf42b485ebc1ab3e1f0a804b8c4e404fa99f1f6f.tar.gz Qt-cf42b485ebc1ab3e1f0a804b8c4e404fa99f1f6f.tar.bz2 |
Fix a small bugs in the example. +two small cleanups.
Diffstat (limited to 'examples/graphicsview/flowlayout/flowlayout.cpp')
-rw-r--r-- | examples/graphicsview/flowlayout/flowlayout.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/graphicsview/flowlayout/flowlayout.cpp b/examples/graphicsview/flowlayout/flowlayout.cpp index 9bbe8a4..d36c37f 100644 --- a/examples/graphicsview/flowlayout/flowlayout.cpp +++ b/examples/graphicsview/flowlayout/flowlayout.cpp @@ -74,6 +74,7 @@ QGraphicsLayoutItem *FlowLayout::itemAt(int index) const void FlowLayout::removeAt(int index) { m_items.removeAt(index); + invalidate(); } qreal FlowLayout::spacing(Qt::Orientation o) const @@ -95,7 +96,7 @@ void FlowLayout::setGeometry(const QRectF &geom) doLayout(geom, true); } -qreal FlowLayout::doLayout(const QRectF &geom, bool applyNewGeometry) +qreal FlowLayout::doLayout(const QRectF &geom, bool applyNewGeometry) const { QPointF tl = geom.topLeft(); qreal maxw = geom.width(); @@ -139,8 +140,7 @@ QSizeF FlowLayout::minSize(const QSizeF &constraint) const qreal left, top, right, bottom; getContentsMargins(&left, &top, &right, &bottom); if (constraint.width() > 0) { // height for width - FlowLayout *that = const_cast<FlowLayout *>(this); - qreal height = that->doLayout(QRectF(QPointF(0,0), constraint), false); + qreal height = doLayout(QRectF(QPointF(0,0), constraint), false); size = QSizeF(constraint.width(), height); } else { QGraphicsLayoutItem *item; |