diff options
author | Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> | 2009-10-07 22:41:32 (GMT) |
---|---|---|
committer | Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> | 2009-10-09 14:18:43 (GMT) |
commit | b6be5eb62a79f7c0d3718a05b18dcf69d2c21550 (patch) | |
tree | a8b3644d7e053076fd5c39026323992407e3fd5e /src | |
parent | cce279d015ccf19200153b43b7f378e25d0913d3 (diff) | |
download | Qt-b6be5eb62a79f7c0d3718a05b18dcf69d2c21550.zip Qt-b6be5eb62a79f7c0d3718a05b18dcf69d2c21550.tar.gz Qt-b6be5eb62a79f7c0d3718a05b18dcf69d2c21550.tar.bz2 |
QGAL: add a way to test whether simplex was used in a calculation
This is one good way to track whether simplification is doing all its
job or not. However it can only track cases where the graph simplify
to only one anchor. For more complex cases the graph dumps are the way
to go.
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Reviewed-by: Artur Duque de Souza <artur.souza@openbossa.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout_p.cpp | 8 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout_p.h | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp index c921b60..b92d1c3 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp @@ -1689,6 +1689,10 @@ void QGraphicsAnchorLayoutPrivate::calculateGraphs( orientation == Horizontal ? "Horizontal" : "Vertical"); #endif +#ifdef QT_DEBUG + lastCalculationUsedSimplex[orientation] = true; +#endif + // Solve min and max size hints for trunk qreal min, max; feasible = solveMinMax(trunkConstraints, trunkPath, &min, &max); @@ -1738,6 +1742,10 @@ void QGraphicsAnchorLayoutPrivate::calculateGraphs( orientation == Horizontal ? "Horizontal" : "Vertical"); #endif +#ifdef QT_DEBUG + lastCalculationUsedSimplex[orientation] = false; +#endif + // No Simplex is necessary because the path was simplified all the way to a single // anchor. Q_ASSERT(trunkPath.positives.count() == 1); diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.h b/src/gui/graphicsview/qgraphicsanchorlayout_p.h index ea19ecb..7d38e40 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.h +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.h @@ -513,6 +513,10 @@ public: bool graphHasConflicts[2]; QSet<QGraphicsLayoutItem *> m_nonFloatItems[2]; +#ifdef QT_DEBUG + bool lastCalculationUsedSimplex[2]; +#endif + uint calculateGraphCacheDirty : 1; }; |