diff options
author | Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> | 2009-09-15 19:28:56 (GMT) |
---|---|---|
committer | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-09-17 11:58:02 (GMT) |
commit | 312efdc70059562b1a782d5432ef06d08e002631 (patch) | |
tree | 855a7ed9bf0d93e4baae7604cc82f33469947acb /src/gui/graphicsview | |
parent | 26d3ead5771a67a15a672441ce30359aa355b911 (diff) | |
download | Qt-312efdc70059562b1a782d5432ef06d08e002631.zip Qt-312efdc70059562b1a782d5432ef06d08e002631.tar.gz Qt-312efdc70059562b1a782d5432ef06d08e002631.tar.bz2 |
QGraphicsAnchorLayout: Removing methods names inconsistencies on private class
QGraphicsAnchorLayoutPrivate now has addAnchor() replacing anchor() and
addAnchor_helper() replacing addAnchor(). With this changes we are respecting
the API behavior, where anchor() is a "getter" instead of a "setter".
Signed-off-by: Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout.cpp | 6 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout_p.cpp | 24 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout_p.h | 8 |
3 files changed, 19 insertions, 19 deletions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.cpp b/src/gui/graphicsview/qgraphicsanchorlayout.cpp index 5897ae4..efad259 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout.cpp @@ -194,7 +194,7 @@ QGraphicsAnchorLayout::addAnchor(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint QGraphicsLayoutItem *secondItem, Qt::AnchorPoint secondEdge) { Q_D(QGraphicsAnchorLayout); - QGraphicsAnchor *a = d->anchor(firstItem, firstEdge, secondItem, secondEdge); + QGraphicsAnchor *a = d->addAnchor(firstItem, firstEdge, secondItem, secondEdge); invalidate(); return a; } @@ -246,12 +246,12 @@ void QGraphicsAnchorLayout::addCornerAnchors(QGraphicsLayoutItem *firstItem, // Horizontal anchor Qt::AnchorPoint firstEdge = (firstCorner & 1 ? Qt::AnchorRight: Qt::AnchorLeft); Qt::AnchorPoint secondEdge = (secondCorner & 1 ? Qt::AnchorRight: Qt::AnchorLeft); - d->anchor(firstItem, firstEdge, secondItem, secondEdge); + d->addAnchor(firstItem, firstEdge, secondItem, secondEdge); // Vertical anchor firstEdge = (firstCorner & 2 ? Qt::AnchorBottom: Qt::AnchorTop); secondEdge = (secondCorner & 2 ? Qt::AnchorBottom: Qt::AnchorTop); - d->anchor(firstItem, firstEdge, secondItem, secondEdge); + d->addAnchor(firstItem, firstEdge, secondItem, secondEdge); invalidate(); } diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp index 50d1a61..6c93a28 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp @@ -790,7 +790,7 @@ void QGraphicsAnchorLayoutPrivate::createLayoutEdges() // Horizontal AnchorData *data = new AnchorData(0, 0, QWIDGETSIZE_MAX); - addAnchor(layout, Qt::AnchorLeft, layout, + addAnchor_helper(layout, Qt::AnchorLeft, layout, Qt::AnchorRight, data); data->skipInPreferred = 1; @@ -800,7 +800,7 @@ void QGraphicsAnchorLayoutPrivate::createLayoutEdges() // Vertical data = new AnchorData(0, 0, QWIDGETSIZE_MAX); - addAnchor(layout, Qt::AnchorTop, layout, + addAnchor_helper(layout, Qt::AnchorTop, layout, Qt::AnchorBottom, data); data->skipInPreferred = 1; @@ -832,7 +832,7 @@ void QGraphicsAnchorLayoutPrivate::createItemEdges(QGraphicsLayoutItem *item) int maximumSize = item->maximumWidth(); AnchorData *data = new AnchorData(minimumSize, preferredSize, maximumSize); - addAnchor(item, Qt::AnchorLeft, item, + addAnchor_helper(item, Qt::AnchorLeft, item, Qt::AnchorRight, data); // Vertical @@ -841,7 +841,7 @@ void QGraphicsAnchorLayoutPrivate::createItemEdges(QGraphicsLayoutItem *item) maximumSize = item->maximumHeight(); data = new AnchorData(minimumSize, preferredSize, maximumSize); - addAnchor(item, Qt::AnchorTop, item, + addAnchor_helper(item, Qt::AnchorTop, item, Qt::AnchorBottom, data); } @@ -904,11 +904,11 @@ void QGraphicsAnchorLayoutPrivate::createCenterAnchors( QSimplexConstraint *c = new QSimplexConstraint; AnchorData *data = new AnchorData(minimumSize, preferredSize, maximumSize); c->variables.insert(data, 1.0); - addAnchor(item, firstEdge, item, centerEdge, data); + addAnchor_helper(item, firstEdge, item, centerEdge, data); data = new AnchorData(minimumSize, preferredSize, maximumSize); c->variables.insert(data, -1.0); - addAnchor(item, centerEdge, item, lastEdge, data); + addAnchor_helper(item, centerEdge, item, lastEdge, data); itemCenterConstraints[orientation].append(c); @@ -976,7 +976,7 @@ void QGraphicsAnchorLayoutPrivate::removeCenterAnchors( int maximumSize = oldData->maxSize * 2; AnchorData *data = new AnchorData(minimumSize, preferredSize, maximumSize); - addAnchor(item, firstEdge, item, lastEdge, data); + addAnchor_helper(item, firstEdge, item, lastEdge, data); // Remove old anchors removeAnchor(item, firstEdge, item, centerEdge); @@ -1039,7 +1039,7 @@ void QGraphicsAnchorLayoutPrivate::removeCenterConstraints(QGraphicsLayoutItem * * Helper function that is called from the anchor functions in the public API. * If \a spacing is 0, it will pick up the spacing defined by the style. */ -QGraphicsAnchor *QGraphicsAnchorLayoutPrivate::anchor(QGraphicsLayoutItem *firstItem, +QGraphicsAnchor *QGraphicsAnchorLayoutPrivate::addAnchor(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint firstEdge, QGraphicsLayoutItem *secondItem, Qt::AnchorPoint secondEdge, @@ -1112,18 +1112,18 @@ QGraphicsAnchor *QGraphicsAnchorLayoutPrivate::anchor(QGraphicsLayoutItem *first } else { data = new AnchorData(0); // spacing should be 0 } - addAnchor(firstItem, firstEdge, secondItem, secondEdge, data); + addAnchor_helper(firstItem, firstEdge, secondItem, secondEdge, data); } else if (*spacing >= 0) { data = new AnchorData(*spacing); - addAnchor(firstItem, firstEdge, secondItem, secondEdge, data); + addAnchor_helper(firstItem, firstEdge, secondItem, secondEdge, data); } else { data = new AnchorData(-*spacing); - addAnchor(secondItem, secondEdge, firstItem, firstEdge, data); + addAnchor_helper(secondItem, secondEdge, firstItem, firstEdge, data); } return acquireGraphicsAnchor(data); } -void QGraphicsAnchorLayoutPrivate::addAnchor(QGraphicsLayoutItem *firstItem, +void QGraphicsAnchorLayoutPrivate::addAnchor_helper(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint firstEdge, QGraphicsLayoutItem *secondItem, Qt::AnchorPoint secondEdge, diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.h b/src/gui/graphicsview/qgraphicsanchorlayout_p.h index f701c3f..9316847 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.h +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.h @@ -403,15 +403,15 @@ public: return data->graphicsAnchor; } - // helper function used by the 4 API functions - QGraphicsAnchor *anchor(QGraphicsLayoutItem *firstItem, + // function used by the 4 API functions + QGraphicsAnchor *addAnchor(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint firstEdge, QGraphicsLayoutItem *secondItem, Qt::AnchorPoint secondEdge, qreal *spacing = 0); - // Anchor Manipulation methods - void addAnchor(QGraphicsLayoutItem *firstItem, + // Helper for Anchor Manipulation methods + void addAnchor_helper(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint firstEdge, QGraphicsLayoutItem *secondItem, Qt::AnchorPoint secondEdge, |