summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsanchorlayout_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/graphicsview/qgraphicsanchorlayout_p.h')
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.h b/src/gui/graphicsview/qgraphicsanchorlayout_p.h
index 8529e2e..3be9d41 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout_p.h
+++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.h
@@ -123,17 +123,17 @@ struct AnchorData : public QSimplexVariable {
AnchorData()
: QSimplexVariable(), from(0), to(0),
minSize(0), prefSize(0), maxSize(0),
+ minPrefSize(0), maxPrefSize(0),
sizeAtMinimum(0), sizeAtPreferred(0),
sizeAtMaximum(0), item(0), graphicsAnchor(0),
type(Normal), isLayoutAnchor(false),
isCenterAnchor(false), orientation(0),
dependency(Independent) {}
+ virtual ~AnchorData();
virtual void updateChildrenSizes() {}
void refreshSizeHints(const QLayoutStyleInfo *styleInfo = 0);
- virtual ~AnchorData() {}
-
#ifdef QT_DEBUG
void dump(int indent = 2);
inline QString toString() const;
@@ -154,6 +154,9 @@ struct AnchorData : public QSimplexVariable {
qreal prefSize;
qreal maxSize;
+ qreal minPrefSize;
+ qreal maxPrefSize;
+
// Calculated sizes
// These attributes define which sizes should that anchor be in when the
// layout is at its minimum, preferred or maximum sizes. Values are
@@ -213,7 +216,8 @@ struct ParallelAnchorData : public AnchorData
Q_ASSERT(((first->from == second->from) && (first->to == second->to)) ||
((first->from == second->to) && (first->to == second->from)));
- // We arbitrarily choose the direction of the first child as "our" direction
+ // Our convention will be that the parallel group anchor will have the same
+ // direction as the first anchor.
from = first->from;
to = first->to;
#ifdef QT_DEBUG
@@ -224,6 +228,13 @@ struct ParallelAnchorData : public AnchorData
virtual void updateChildrenSizes();
bool calculateSizeHints();
+ bool secondForward() const {
+ // We have the convention that the first children will define the direction of the
+ // pararell group. Note that we can't rely on 'this->from' or 'this->to' because they
+ // might be changed by vertex simplification.
+ return firstEdge->from == secondEdge->from;
+ }
+
AnchorData* firstEdge;
AnchorData* secondEdge;
@@ -343,7 +354,6 @@ public:
qreal preferredSize;
uint hasSize : 1; // if false, get size from style.
- uint reversed : 1; // if true, the anchor was inverted to keep its value positive
};
@@ -365,8 +375,10 @@ public:
//
// Interval represents which interpolation interval are we operating in.
enum Interval {
- MinToPreferred = 0,
- PreferredToMax
+ MinimumToMinPreferred = 0,
+ MinPreferredToPreferred,
+ PreferredToMaxPreferred,
+ MaxPreferredToMaximum
};
// Several structures internal to the layout are duplicated to handle