diff options
author | Eduardo M. Fleury <eduardo.fleury@openbossa.org> | 2009-08-08 00:51:11 (GMT) |
---|---|---|
committer | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-08-10 07:49:34 (GMT) |
commit | 2f5516cc5a8990e6d1bc5d8d557c421dc0150265 (patch) | |
tree | b0669a8893229778efcfb4bf9b269ed8de59a629 /src/gui | |
parent | c08f8182d81e053b4030e8883acb95de1d9aba84 (diff) | |
download | Qt-2f5516cc5a8990e6d1bc5d8d557c421dc0150265.zip Qt-2f5516cc5a8990e6d1bc5d8d557c421dc0150265.tar.gz Qt-2f5516cc5a8990e6d1bc5d8d557c421dc0150265.tar.bz2 |
QGraphicsAnchorLayout: Adding calculateGraphs() method documentation
That's too important a method to remain without at least some doc ;)
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout_p.cpp | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp index 4844748..52fac1d 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp @@ -984,6 +984,29 @@ QList<AnchorData *> getVariables(QList<QSimplexConstraint *> constraints) return variableSet.toList(); } +/*! + \internal + + Calculate graphs is the method that puts together all the helper routines + so that the AnchorLayout can calculate the sizes of each item. + + In a nutshell it should do: + + 1) Update anchor nominal sizes, that is, the size that each anchor would + have if no other restrictions applied. This is done by quering the + layout style and the sizeHints of the items belonging to the layout. + + 2) Simplify the graph by grouping together parallel and sequential anchors + into "group anchors". These have equivalent minimum, preferred and maximum + sizeHints as the anchors they replace. + + 3) Check if we got to a trivial case. In some cases, the whole graph can be + simplified into a single anchor. If so, use this information. If not, + then call the Simplex solver to calculate the anchors sizes. + + 4) Once the root anchors had its sizes calculated, propagate that to the + anchors they represent. +*/ void QGraphicsAnchorLayoutPrivate::calculateGraphs( QGraphicsAnchorLayoutPrivate::Orientation orientation) { @@ -992,13 +1015,6 @@ void QGraphicsAnchorLayoutPrivate::calculateGraphs( // Reset the nominal sizes of each anchor based on the current item sizes setAnchorSizeHintsFromItems(orientation); -// ### currently crashes - //q->dumpGraph(); -// simplifyGraph(orientation); - //q->dumpGraph(); -// restoreSimplifiedGraph(orientation); // should not be here - //q->dumpGraph(); - // Reset the nominal sizes of each anchor based on the current item sizes setAnchorSizeHintsFromDefaults(orientation); |