diff options
author | Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> | 2009-10-08 18:52:11 (GMT) |
---|---|---|
committer | Eduardo M. Fleury <eduardo.fleury@openbossa.org> | 2009-10-15 14:37:51 (GMT) |
commit | eb2717ccbb20334b52aea269303258fe6236c117 (patch) | |
tree | 9e6f55d31a32bb9813ff45d3b8935710b509eb8b /src/gui/graphicsview/qgraphicsanchorlayout_p.h | |
parent | 1501429a78d647f922dfdb4432fbfac333143c91 (diff) | |
download | Qt-eb2717ccbb20334b52aea269303258fe6236c117.zip Qt-eb2717ccbb20334b52aea269303258fe6236c117.tar.gz Qt-eb2717ccbb20334b52aea269303258fe6236c117.tar.bz2 |
QGAL: avoid having to re-calculate lists of variables
Change the functions solvePreferred() and solveExpanding() to take a
list of variables, so they don't need to calculate them based on the
list of constraints. That way, the trunk variables are calculated only
once.
This commit also reduce the scope of 'sizeHintConstraints' variable
instead of clearing and reusing it.
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/graphicsview/qgraphicsanchorlayout_p.h')
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout_p.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.h b/src/gui/graphicsview/qgraphicsanchorlayout_p.h index b14bc62..1d7b758 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.h +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.h @@ -471,10 +471,12 @@ public: Orientation orientation); // Linear Programming solver methods - bool solveMinMax(QList<QSimplexConstraint *> constraints, + bool solveMinMax(const QList<QSimplexConstraint *> &constraints, GraphPath path, qreal *min, qreal *max); - bool solvePreferred(QList<QSimplexConstraint *> constraints); - void solveExpanding(QList<QSimplexConstraint *> constraints); + bool solvePreferred(const QList<QSimplexConstraint *> &constraints, + const QList<AnchorData *> &variables); + void solveExpanding(const QList<QSimplexConstraint *> &constraints, + const QList<AnchorData *> &variables); bool hasConflicts() const; #ifdef QT_DEBUG |