summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsanchorlayout_p.h
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2009-08-19 13:47:18 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2009-08-19 13:47:18 (GMT)
commit784bef39ca505e1e4a6f2ec6742183b7750b4f47 (patch)
treee1902a60a7732ffdf8d265a1320d7bf7d6e93251 /src/gui/graphicsview/qgraphicsanchorlayout_p.h
parent14c6433781fb946aab6e7f77fd190469e5fcfb94 (diff)
downloadQt-784bef39ca505e1e4a6f2ec6742183b7750b4f47.zip
Qt-784bef39ca505e1e4a6f2ec6742183b7750b4f47.tar.gz
Qt-784bef39ca505e1e4a6f2ec6742183b7750b4f47.tar.bz2
Implement the functions we added in the API review:
Those are: * setAnchorSpacing() * anchorSpacing() * unsetAnchorSpacing() Autotests for the two last ones are missing though..
Diffstat (limited to 'src/gui/graphicsview/qgraphicsanchorlayout_p.h')
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.h b/src/gui/graphicsview/qgraphicsanchorlayout_p.h
index 742108d..e17bd28 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout_p.h
+++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.h
@@ -176,6 +176,11 @@ struct AnchorData : public QSimplexVariable {
hasSize = true;
}
+ inline void unsetSize()
+ {
+ hasSize = false;
+ }
+
// Anchor is semantically directed
AnchorVertex *from;
AnchorVertex *to;
@@ -367,7 +372,15 @@ public:
Qt::AnchorPoint firstEdge,
const QGraphicsLayoutItem *secondItem,
Qt::AnchorPoint secondEdge,
- qreal anchorSize);
+ const qreal *anchorSize);
+
+ bool anchorSize(const QGraphicsLayoutItem *firstItem,
+ Qt::AnchorPoint firstEdge,
+ const QGraphicsLayoutItem *secondItem,
+ Qt::AnchorPoint secondEdge,
+ qreal *minSize = 0,
+ qreal *prefSize = 0,
+ qreal *maxSize = 0) const;
void removeAnchors(QGraphicsLayoutItem *item);
@@ -394,12 +407,12 @@ public:
QList<QSimplexConstraint *> constraintsFromSizeHints(const QList<AnchorData *> &anchors);
QList<QList<QSimplexConstraint *> > getGraphParts(Orientation orientation);
- inline AnchorVertex *internalVertex(const QPair<QGraphicsLayoutItem*, Qt::AnchorPoint> &itemEdge)
+ inline AnchorVertex *internalVertex(const QPair<QGraphicsLayoutItem*, Qt::AnchorPoint> &itemEdge) const
{
return m_vertexList.value(itemEdge).first;
}
- inline AnchorVertex *internalVertex(const QGraphicsLayoutItem *item, Qt::AnchorPoint edge)
+ inline AnchorVertex *internalVertex(const QGraphicsLayoutItem *item, Qt::AnchorPoint edge) const
{
return internalVertex(qMakePair(const_cast<QGraphicsLayoutItem *>(item), edge));
}