From a5e99a6812e8a721dac29554ebcaa92c6d3fdd3a Mon Sep 17 00:00:00 2001 From: "Eduardo M. Fleury" Date: Thu, 28 May 2009 15:48:44 -0300 Subject: QGraphicsAnchorLayout: Bugfix in spacing() method In the public Qt::Orientation enum, Horizontal and Vertical mean 0x1 and 0x2 respectivelly, this was causing the internal data structure to be accessed in positions 0 and 2 instead of 0 and 1. Signed-off-by: Eduardo M. Fleury --- src/gui/graphicsview/qgraphicsanchorlayout.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.cpp b/src/gui/graphicsview/qgraphicsanchorlayout.cpp index 631ce0c..166e6f2 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout.cpp @@ -172,7 +172,8 @@ void QGraphicsAnchorLayout::setSpacing(qreal spacing, Qt::Orientations orientati qreal QGraphicsAnchorLayout::spacing(Qt::Orientation orientation) const { Q_D(const QGraphicsAnchorLayout); - return d->spacing[orientation & Qt::Vertical]; + // Qt::Horizontal == 0x1, Qt::Vertical = 0x2 + return d->spacing[orientation - 1]; } void QGraphicsAnchorLayout::setGeometry(const QRectF &geom) -- cgit v0.12