From f95dfb70e5c963b5c2502b94c2c391994b0e17ee Mon Sep 17 00:00:00 2001 From: Caio Marcelo de Oliveira Filho Date: Thu, 13 Aug 2009 15:36:29 -0300 Subject: QGraphicsAnchorLayout: remove unused function The function setAnchorSizeHintsFromDefaults() is not necessary, since a more updated version (ready or almost-ready for simplification) was added: setAnchorSizeHintsFromItems(). Signed-off-by: Caio Marcelo de Oliveira Filho --- src/gui/graphicsview/qgraphicsanchorlayout_p.cpp | 30 ------------------------ src/gui/graphicsview/qgraphicsanchorlayout_p.h | 1 - 2 files changed, 31 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp index e75bf19..83ba3b5 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp @@ -1121,9 +1121,6 @@ void QGraphicsAnchorLayoutPrivate::calculateGraphs( // Reset the nominal sizes of each anchor based on the current item sizes setAnchorSizeHintsFromItems(orientation); - // Reset the nominal sizes of each anchor based on the current item sizes - //setAnchorSizeHintsFromDefaults(orientation); - // Simplify the graph // ### Ideally we would like to do that if, and only if, anchors had // been added or removed since the last time this method was called. @@ -1255,33 +1252,6 @@ void QGraphicsAnchorLayoutPrivate::calculateGraphs( graphPaths[orientation].clear(); // ### } -void QGraphicsAnchorLayoutPrivate::setAnchorSizeHintsFromDefaults(Orientation orientation) -{ - Graph &g = graph[orientation]; - QSet setOfVertices = g.vertices(); - - for (QSet::const_iterator it = setOfVertices.begin(); it != setOfVertices.end(); ++it) { - AnchorVertex *v = *it; - QList adjacents = g.adjacentVertices(v); - for (int i = 0; i < adjacents.count(); ++i) { - AnchorVertex *v1 = adjacents.at(i); - AnchorData *data = g.edgeData(v, v1); - if (!data->hasSize) { - bool forward = data->origin == v; - if (forward) { - qreal s = effectiveSpacing(orientation); - data->minSize = s; - data->prefSize = s; - data->maxSize = s; - data->sizeAtMinimum = s; - data->sizeAtPreferred = s; - data->sizeAtMaximum = s; - } - } - } - } -} - /*! \internal diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.h b/src/gui/graphicsview/qgraphicsanchorlayout_p.h index 3b5f64b..fa79f6b 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.h +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.h @@ -347,7 +347,6 @@ public: void calculateGraphs(); void calculateGraphs(Orientation orientation); void setAnchorSizeHintsFromItems(Orientation orientation); - void setAnchorSizeHintsFromDefaults(Orientation orientation); void findPaths(Orientation orientation); void constraintsFromPaths(Orientation orientation); QList constraintsFromSizeHints(const QList &anchors); -- cgit v0.12