summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsanchorlayout_p.h
diff options
context:
space:
mode:
authorEduardo M. Fleury <eduardo.fleury@openbossa.org>2009-09-22 17:20:10 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2009-10-06 09:28:21 (GMT)
commitbfc1a75616e1c96a018349084fae844d7efbc177 (patch)
treed956c9f8b489c0cae43829b2f04caa2b0e4e7f5d /src/gui/graphicsview/qgraphicsanchorlayout_p.h
parent933e74473a23c0090eaaae9c6122a0e0d192df15 (diff)
downloadQt-bfc1a75616e1c96a018349084fae844d7efbc177.zip
Qt-bfc1a75616e1c96a018349084fae844d7efbc177.tar.gz
Qt-bfc1a75616e1c96a018349084fae844d7efbc177.tar.bz2
QGraphicsAnchorLayout: Add data structures for Expanding size policy
Adding required members for the upcoming support of the QSizePolicy::Expand flag. In this state, running with simplification will probably not work. Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Artur Duque de Souza <artur.souza@openbossa.org>
Diffstat (limited to 'src/gui/graphicsview/qgraphicsanchorlayout_p.h')
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.h b/src/gui/graphicsview/qgraphicsanchorlayout_p.h
index c86bfa3..4c6c2aa 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout_p.h
+++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.h
@@ -153,7 +153,8 @@ struct AnchorData : public QSimplexVariable {
: QSimplexVariable(), from(0), to(0),
minSize(minimumSize), prefSize(preferredSize),
maxSize(maximumSize), sizeAtMinimum(preferredSize),
- sizeAtPreferred(preferredSize), sizeAtMaximum(preferredSize),
+ sizeAtPreferred(preferredSize), sizeAtExpanding(preferredSize),
+ sizeAtMaximum(preferredSize),
graphicsAnchor(0),
skipInPreferred(0), type(Normal), hasSize(true),
isLayoutAnchor(false) {}
@@ -161,7 +162,8 @@ struct AnchorData : public QSimplexVariable {
AnchorData(qreal size)
: QSimplexVariable(), from(0), to(0),
minSize(size), prefSize(size), maxSize(size),
- sizeAtMinimum(size), sizeAtPreferred(size), sizeAtMaximum(size),
+ sizeAtMinimum(size), sizeAtPreferred(size), sizeAtExpanding(size),
+ sizeAtMaximum(size),
graphicsAnchor(0),
skipInPreferred(0), type(Normal), hasSize(true),
isLayoutAnchor(false) {}
@@ -169,7 +171,8 @@ struct AnchorData : public QSimplexVariable {
AnchorData()
: QSimplexVariable(), from(0), to(0),
minSize(0), prefSize(0), maxSize(0),
- sizeAtMinimum(0), sizeAtPreferred(0), sizeAtMaximum(0),
+ sizeAtMinimum(0), sizeAtPreferred(0), sizeAtExpanding(0),
+ sizeAtMaximum(0),
graphicsAnchor(0),
skipInPreferred(0), type(Normal), hasSize(false),
isLayoutAnchor(false) {}
@@ -192,6 +195,7 @@ struct AnchorData : public QSimplexVariable {
maxSize = size;
sizeAtMinimum = size;
sizeAtPreferred = size;
+ sizeAtExpanding = size;
sizeAtMaximum = size;
hasSize = true;
}
@@ -218,6 +222,7 @@ struct AnchorData : public QSimplexVariable {
// calculated by the Simplex solver based on the current layout setup.
qreal sizeAtMinimum;
qreal sizeAtPreferred;
+ qreal sizeAtExpanding;
qreal sizeAtMaximum;
QGraphicsAnchor *graphicsAnchor;
@@ -225,12 +230,15 @@ struct AnchorData : public QSimplexVariable {
uint type : 2; // either Normal, Sequential or Parallel
uint hasSize : 1; // if false, get size from style.
uint isLayoutAnchor : 1; // if this anchor is connected to a layout 'edge'
+ uint isExpanding : 1; // if true, expands before other anchors
+
protected:
AnchorData(Type type, qreal size = 0)
: QSimplexVariable(), from(0), to(0),
minSize(size), prefSize(size),
maxSize(size), sizeAtMinimum(size),
- sizeAtPreferred(size), sizeAtMaximum(size),
+ sizeAtPreferred(size), sizeAtExpanding(size),
+ sizeAtMaximum(size),
graphicsAnchor(0),
skipInPreferred(0), type(type), hasSize(true),
isLayoutAnchor(false) {}
@@ -355,7 +363,8 @@ public:
// Interval represents which interpolation interval are we operating in.
enum Interval {
MinToPreferred = 0,
- PreferredToMax
+ PreferredToExpanding,
+ ExpandingToMax
};
// Several structures internal to the layout are duplicated to handle
@@ -496,6 +505,7 @@ public:
qreal spacings[NOrientations];
// Size hints from simplex engine
qreal sizeHints[2][3];
+ qreal sizeAtExpanding[2];
// Items
QVector<QGraphicsLayoutItem *> items;