summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsanchorlayout_p.h
diff options
context:
space:
mode:
authorEduardo M. Fleury <eduardo.fleury@openbossa.org>2009-11-04 13:49:05 (GMT)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>2009-11-06 18:16:38 (GMT)
commit8ee95e63a92b07ba89003243b0e93718762a7d88 (patch)
treeb6dfc679deb29533e31ef4ac5d1d0b043dfda72f /src/gui/graphicsview/qgraphicsanchorlayout_p.h
parent77f81c95635ecac0fc3516b4a4b71f84ffb56bfd (diff)
downloadQt-8ee95e63a92b07ba89003243b0e93718762a7d88.zip
Qt-8ee95e63a92b07ba89003243b0e93718762a7d88.tar.gz
Qt-8ee95e63a92b07ba89003243b0e93718762a7d88.tar.bz2
QGAL: Support for out-of-order parallel anchors
Now parallel anchors account for the fact they may be composed of anchors with different directions. We arbitrarily set the direction of the parallel anchor to be the same direction as the first child. The methods refreshSizeHints and updateChildren were updated to support this situation. Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Diffstat (limited to 'src/gui/graphicsview/qgraphicsanchorlayout_p.h')
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.h b/src/gui/graphicsview/qgraphicsanchorlayout_p.h
index 1e11ee2..8d77b1a 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout_p.h
+++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.h
@@ -256,10 +256,11 @@ struct ParallelAnchorData : public AnchorData
type = AnchorData::Parallel;
orientation = first->orientation;
- // ### Those asserts force that both child anchors have the same direction,
- // but can't we simplify a pair of anchors in opposite directions?
- Q_ASSERT(first->from == second->from);
- Q_ASSERT(first->to == second->to);
+ // This assert whether the child anchors share their vertices
+ Q_ASSERT(((first->from == second->from) && (first->to == second->to)) ||
+ ((first->from == second->to) && (first->to == second->from)));
+
+ // We arbitrarily choose the direction of the first child as "our" direction
from = first->from;
to = first->to;
#ifdef QT_DEBUG