diff options
author | Jan Arve Saether <jan-arve.saether@digia.com> | 2014-01-02 17:44:34 +0100 |
---|---|---|
committer | Jan Arve Sæther <jan-arve.saether@theqtcompany.com> | 2014-12-01 14:37:02 +0100 |
commit | 7cea5949ca5c23a840978dcb80014085e467e9eb (patch) | |
tree | 289931e6189ed5b4f436f7a5cfd5a0da56cdbd07 /src/gui/util/qabstractlayoutstyleinfo_p.h | |
parent | 9431321c653e4f387d7d27c410d22aabb2d042ef (diff) | |
download | qtbase-7cea5949ca5c23a840978dcb80014085e467e9eb.tar.gz |
Don't rely on hasChanged() in ensureGeometries
It can be removed now because we now have a better caching
mechanism than before. It should therefore not be needed anymore.
Since nothing else calls hasChanged, we can finally get rid of it.
This simplifies the code and enables us to further improvements to the
code.
Change-Id: I51afe5a97311e3e361ae8b491ecbcd21bbedacd1
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/gui/util/qabstractlayoutstyleinfo_p.h')
-rw-r--r-- | src/gui/util/qabstractlayoutstyleinfo_p.h | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/gui/util/qabstractlayoutstyleinfo_p.h b/src/gui/util/qabstractlayoutstyleinfo_p.h index 3479c47c4e..d64cb94aa4 100644 --- a/src/gui/util/qabstractlayoutstyleinfo_p.h +++ b/src/gui/util/qabstractlayoutstyleinfo_p.h @@ -53,13 +53,8 @@ QT_BEGIN_NAMESPACE class Q_GUI_EXPORT QAbstractLayoutStyleInfo { public: - typedef enum { - Unknown = 0, - Changed, - Unchanged - } ChangedState; - QAbstractLayoutStyleInfo() : m_isWindow(false), m_changed(Changed) {} + QAbstractLayoutStyleInfo() : m_isWindow(false) {} virtual ~QAbstractLayoutStyleInfo() {} virtual qreal combinedLayoutSpacing(QLayoutPolicy::ControlTypes /*controls1*/, QLayoutPolicy::ControlTypes /*controls2*/, Qt::Orientation /*orientation*/) const { @@ -74,15 +69,9 @@ public: virtual qreal spacing(Qt::Orientation orientation) const = 0; - virtual bool hasChangedCore() const = 0; + virtual bool hasChangedCore() const { return false; } // ### Remove when usage is gone from subclasses - void updateChanged(ChangedState change) { - m_changed = change; - } - - bool hasChanged() const; - - virtual void invalidate() { updateChanged(Changed);} + virtual void invalidate() { } virtual qreal windowMargin(Qt::Orientation orientation) const = 0; @@ -92,7 +81,9 @@ public: protected: unsigned m_isWindow : 1; - mutable unsigned m_changed : 2; + mutable unsigned m_hSpacingState: 2; + mutable unsigned m_vSpacingState: 2; + mutable qreal m_spacing[2]; }; QT_END_NAMESPACE |