summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>2009-10-07 22:41:32 (GMT)
committerEduardo M. Fleury <eduardo.fleury@openbossa.org>2009-10-15 14:37:51 (GMT)
commit1501429a78d647f922dfdb4432fbfac333143c91 (patch)
tree1a891e5d87f38301602902947a7a0ea389453fad /src/gui
parenta0b0e6b086b493aa833596a7d228ca7eb27be47e (diff)
downloadQt-1501429a78d647f922dfdb4432fbfac333143c91.zip
Qt-1501429a78d647f922dfdb4432fbfac333143c91.tar.gz
Qt-1501429a78d647f922dfdb4432fbfac333143c91.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/gui')
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.cpp8
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.h4
2 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
index f090aa3..b61405f 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 9b50661..b14bc62 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_floatItems[2];
+#ifdef QT_DEBUG
+ bool lastCalculationUsedSimplex[2];
+#endif
+
uint calculateGraphCacheDirty : 1;
};