diff options
author | Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> | 2009-10-19 19:17:35 (GMT) |
---|---|---|
committer | Eduardo M. Fleury <eduardo.fleury@openbossa.org> | 2009-10-26 22:17:51 (GMT) |
commit | a79539b1364fa8c155c5fbd00a977ae40b24acbe (patch) | |
tree | c5d2ec6a94e262519abff5ea9d98cd4f95b79231 /src/gui/graphicsview/qgraphicsanchorlayout_p.cpp | |
parent | 73d89d68d5d710e86e6aa74b2924ee4aca11881e (diff) | |
download | Qt-a79539b1364fa8c155c5fbd00a977ae40b24acbe.zip Qt-a79539b1364fa8c155c5fbd00a977ae40b24acbe.tar.gz Qt-a79539b1364fa8c155c5fbd00a977ae40b24acbe.tar.bz2 |
QGAL: clarify the usage of isLayoutAnchor bit
The 'isLayoutAnchor' is necessary only as a way to flag Layout
internal anchors, i.e. anchors with the Layout as 'item' in the
AnchorData structure.
We don't need to propagate this bit when composing anchors.
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Diffstat (limited to 'src/gui/graphicsview/qgraphicsanchorlayout_p.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout_p.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp index 41e067c..7dbfba9 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp @@ -527,8 +527,6 @@ static AnchorData *addAnchorMaybeParallel(Graph<AnchorVertex, AnchorData> *g, // anchor. if (AnchorData *oldAnchor = g->takeEdge(newAnchor->from, newAnchor->to)) { ParallelAnchorData *parallel = new ParallelAnchorData(oldAnchor, newAnchor); - parallel->isLayoutAnchor = (oldAnchor->isLayoutAnchor - || newAnchor->isLayoutAnchor); // At this point we can identify that the parallel anchor is not feasible, e.g. one // anchor minimum size is bigger than the other anchor maximum size. @@ -596,12 +594,6 @@ static AnchorData *createSequence(Graph<AnchorVertex, AnchorData> *graph, sequence->refreshSizeHints_helper(0, false); - // Note that since layout 'edges' can't be simplified away from - // the graph, it's safe to assume that if there's a layout - // 'edge', it'll be in the boundaries of the sequence. - sequence->isLayoutAnchor = (sequence->m_edges.first()->isLayoutAnchor - || sequence->m_edges.last()->isLayoutAnchor); - return sequence; } @@ -1313,8 +1305,9 @@ void QGraphicsAnchorLayoutPrivate::addAnchor_helper(QGraphicsLayoutItem *firstIt #ifdef QT_DEBUG data->name = QString::fromAscii("%1 --to--> %2").arg(v1->toString()).arg(v2->toString()); #endif - // Keep track of anchors that are connected to the layout 'edges' - data->isLayoutAnchor = (v1->m_item == q || v2->m_item == q); + // ### bit to track internal anchors, since inside AnchorData methods + // we don't have access to the 'q' pointer. + data->isLayoutAnchor = (data->item == q); graph[orientation].createEdge(v1, v2, data); } |