diff options
author | Eduardo M. Fleury <eduardo.fleury@openbossa.org> | 2009-11-10 19:55:43 (GMT) |
---|---|---|
committer | Eduardo M. Fleury <eduardo.fleury@openbossa.org> | 2009-11-12 21:35:27 (GMT) |
commit | 6cc1703af1f403168b7251616a7685aa83de8caa (patch) | |
tree | 81d2c9fc31eb809e0095dc40d94ba21ceb85c374 /src/gui/graphicsview/qgraphicsanchorlayout.h | |
parent | bf0e30ce2987a9e93369fe01ab0f01eeb1d3afdb (diff) | |
download | Qt-6cc1703af1f403168b7251616a7685aa83de8caa.zip Qt-6cc1703af1f403168b7251616a7685aa83de8caa.tar.gz Qt-6cc1703af1f403168b7251616a7685aa83de8caa.tar.bz2 |
QGAL: Move size information from AnchorData to QGraphicsAnchorPrivate
To solve the spacing persistency bug, this commit saves the
preferredSize (spacing) information inside QGraphicsAnchorPrivate.
The problem started when we could not rely on "AnchorData->prefSize"
to keep the spacing information for user-defined anchors. This happens
because that member can be overriden if the spacing is negative
(anchor is inverted) or its sizePolicy is of type "Ignored" (it is
overriden by minSize).
Then, to decide where to store it, we aimed to make something similar
to what happens with item-internal anchors. Those can rely on their
items to get fresh information regarding their size, so we decided
that user-anchors (that don't have items, but do have QGraphicsAnchors)
could read such information from there.
This refactory also reduced the deep indirection that existed
in the "QGraphicsAnchor->setSpacing" call. Previously it would
call internal layout methods to do some black magic, that's now gone.
As the spacing information is now stored in the anchor itself, it
can do pretty much all the work and, after that, just invalidate the
layout.
Also, moved information like "AnchorData->hasSize" to QGAnchor as
its pretty much related to the preferredSize information itself.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Diffstat (limited to 'src/gui/graphicsview/qgraphicsanchorlayout.h')
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.h b/src/gui/graphicsview/qgraphicsanchorlayout.h index 01c3a86..1a0c458 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout.h +++ b/src/gui/graphicsview/qgraphicsanchorlayout.h @@ -76,6 +76,7 @@ private: Q_DECLARE_PRIVATE(QGraphicsAnchor) friend class QGraphicsAnchorLayoutPrivate; + friend class AnchorData; }; class Q_GUI_EXPORT QGraphicsAnchorLayout : public QGraphicsLayout |