summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout.cpp6
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.cpp24
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.h8
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,