summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsanchorlayout_p.h
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>2009-11-12 15:21:51 (GMT)
committerEduardo M. Fleury <eduardo.fleury@openbossa.org>2009-11-12 21:35:41 (GMT)
commit3dcc9d6bc6385e2c4f4d7d7366c84b6dcc74508c (patch)
tree360a74f843e047b83970f716c94a1a77e3180bca /src/gui/graphicsview/qgraphicsanchorlayout_p.h
parente52ce79b8eee44742d71bf945e806aa2db06818b (diff)
downloadQt-3dcc9d6bc6385e2c4f4d7d7366c84b6dcc74508c.zip
Qt-3dcc9d6bc6385e2c4f4d7d7366c84b6dcc74508c.tar.gz
Qt-3dcc9d6bc6385e2c4f4d7d7366c84b6dcc74508c.tar.bz2
QGAL: clean up size hint refresh code
The code for refreshing size hints of items / user-created anchors now happens with a graph in full (not simplified). So we don't need to now how to refresh size hints for complex anchors. The code for refreshing complex anchors was used also to initialize the complex anchors (the '_helper' functions). Those were changed to calculateSizeHints() and refreshSizeHints() doesn't need to be virtual anymore. Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Diffstat (limited to 'src/gui/graphicsview/qgraphicsanchorlayout_p.h')
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.h b/src/gui/graphicsview/qgraphicsanchorlayout_p.h
index fd82dd9..2b365fb 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout_p.h
+++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.h
@@ -131,7 +131,7 @@ struct AnchorData : public QSimplexVariable {
dependency(Independent) {}
virtual void updateChildrenSizes() {}
- virtual bool refreshSizeHints(const QLayoutStyleInfo *styleInfo);
+ void refreshSizeHints(const QLayoutStyleInfo *styleInfo = 0);
virtual ~AnchorData() {}
@@ -197,9 +197,7 @@ struct SequentialAnchorData : public AnchorData
}
virtual void updateChildrenSizes();
- virtual bool refreshSizeHints(const QLayoutStyleInfo *styleInfo);
-
- bool refreshSizeHints_helper(const QLayoutStyleInfo *styleInfo, bool refreshChildren = true);
+ void calculateSizeHints();
QVector<AnchorVertex*> m_children; // list of vertices in the sequence
QVector<AnchorData*> m_edges; // keep the list of edges too.
@@ -226,9 +224,7 @@ struct ParallelAnchorData : public AnchorData
}
virtual void updateChildrenSizes();
- virtual bool refreshSizeHints(const QLayoutStyleInfo *styleInfo);
-
- bool refreshSizeHints_helper(const QLayoutStyleInfo *styleInfo, bool refreshChildren = true);
+ bool calculateSizeHints();
AnchorData* firstEdge;
AnchorData* secondEdge;
@@ -483,7 +479,7 @@ public:
const QList<AnchorData *> &variables);
// Support functions for calculateGraph()
- bool refreshAllSizeHints(Orientation orientation);
+ void refreshAllSizeHints(Orientation orientation);
void findPaths(Orientation orientation);
void constraintsFromPaths(Orientation orientation);
void updateAnchorSizes(Orientation orientation);