summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJesus Sanchez-Palencia <jesus.palencia@openbossa.org>2009-09-15 19:59:20 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2009-09-17 11:58:06 (GMT)
commit6cadb9004c10ca3b7b69311c1f885d60ed2afe8b (patch)
tree09f44a6619c65b56e8dcb40da39756e08619a02d /src
parent312efdc70059562b1a782d5432ef06d08e002631 (diff)
downloadQt-6cadb9004c10ca3b7b69311c1f885d60ed2afe8b.zip
Qt-6cadb9004c10ca3b7b69311c1f885d60ed2afe8b.tar.gz
Qt-6cadb9004c10ca3b7b69311c1f885d60ed2afe8b.tar.bz2
QGraphicsAnchorLayoutPrivate: Removing method removeAnchor()
All method calls were replaced by calling removeAnchor_helper(), with internalVertex() calls Signed-off-by: Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Diffstat (limited to 'src')
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.cpp30
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.h4
2 files changed, 12 insertions, 22 deletions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
index 6c93a28..f1b9fe5 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
+++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
@@ -816,8 +816,10 @@ void QGraphicsAnchorLayoutPrivate::deleteLayoutEdges()
Q_ASSERT(internalVertex(q, Qt::AnchorHorizontalCenter) == NULL);
Q_ASSERT(internalVertex(q, Qt::AnchorVerticalCenter) == NULL);
- removeAnchor(q, Qt::AnchorLeft, q, Qt::AnchorRight);
- removeAnchor(q, Qt::AnchorTop, q, Qt::AnchorBottom);
+ removeAnchor_helper(internalVertex(q, Qt::AnchorLeft),
+ internalVertex(q, Qt::AnchorRight));
+ removeAnchor_helper(internalVertex(q, Qt::AnchorTop),
+ internalVertex(q, Qt::AnchorBottom));
}
void QGraphicsAnchorLayoutPrivate::createItemEdges(QGraphicsLayoutItem *item)
@@ -913,7 +915,7 @@ void QGraphicsAnchorLayoutPrivate::createCenterAnchors(
itemCenterConstraints[orientation].append(c);
// Remove old one
- removeAnchor(item, firstEdge, item, lastEdge);
+ removeAnchor_helper(first, last);
}
void QGraphicsAnchorLayoutPrivate::removeCenterAnchors(
@@ -979,8 +981,8 @@ void QGraphicsAnchorLayoutPrivate::removeCenterAnchors(
addAnchor_helper(item, firstEdge, item, lastEdge, data);
// Remove old anchors
- removeAnchor(item, firstEdge, item, centerEdge);
- removeAnchor(item, centerEdge, item, lastEdge);
+ removeAnchor_helper(first, center);
+ removeAnchor_helper(center, internalVertex(item, lastEdge));
} else {
// this is only called from removeAnchors()
@@ -989,13 +991,13 @@ void QGraphicsAnchorLayoutPrivate::removeCenterAnchors(
for (int i = 0; i < adjacents.count(); ++i) {
AnchorVertex *v = adjacents.at(i);
if (v->m_item != item) {
- removeAnchor(item, centerEdge, v->m_item, v->m_edge);
+ removeAnchor_helper(center, internalVertex(v->m_item, v->m_edge));
}
}
// when all non-internal anchors is removed it will automatically merge the
// center anchor into a left-right (or top-bottom) anchor. We must also delete that.
// by this time, the center vertex is deleted and merged into a non-centered internal anchor
- removeAnchor(item, firstEdge, item, lastEdge);
+ removeAnchor_helper(first, internalVertex(item, lastEdge));
}
}
@@ -1142,8 +1144,9 @@ void QGraphicsAnchorLayoutPrivate::addAnchor_helper(QGraphicsLayoutItem *firstIt
// Remove previous anchor
// ### Could we update the existing edgeData rather than creating a new one?
- if (graph[edgeOrientation(firstEdge)].edgeData(v1, v2))
- removeAnchor(firstItem, firstEdge, secondItem, secondEdge);
+ if (graph[edgeOrientation(firstEdge)].edgeData(v1, v2)) {
+ removeAnchor_helper(v1, v2);
+ }
// Create a bi-directional edge in the sense it can be transversed both
// from v1 or v2. "data" however is shared between the two references
@@ -1178,15 +1181,6 @@ QGraphicsAnchor *QGraphicsAnchorLayoutPrivate::getAnchor(QGraphicsLayoutItem *fi
return graphicsAnchor;
}
-void QGraphicsAnchorLayoutPrivate::removeAnchor(QGraphicsLayoutItem *firstItem,
- Qt::AnchorPoint firstEdge,
- QGraphicsLayoutItem *secondItem,
- Qt::AnchorPoint secondEdge)
-{
- removeAnchor_helper(internalVertex(firstItem, firstEdge),
- internalVertex(secondItem, secondEdge));
-}
-
void QGraphicsAnchorLayoutPrivate::removeAnchor_helper(AnchorVertex *v1, AnchorVertex *v2)
{
Q_ASSERT(v1 && v2);
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.h b/src/gui/graphicsview/qgraphicsanchorlayout_p.h
index 9316847..89b49af 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout_p.h
+++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.h
@@ -420,10 +420,6 @@ public:
QGraphicsAnchor *getAnchor(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint firstEdge,
QGraphicsLayoutItem *secondItem, Qt::AnchorPoint secondEdge);
- void removeAnchor(QGraphicsLayoutItem *firstItem,
- Qt::AnchorPoint firstEdge,
- QGraphicsLayoutItem *secondItem,
- Qt::AnchorPoint secondEdge);
void removeAnchor_helper(AnchorVertex *v1, AnchorVertex *v2);
void deleteAnchorData(AnchorData *data);
void setAnchorSize(AnchorData *data, const qreal *anchorSize);