summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qsizepolicy.h
diff options
context:
space:
mode:
authorThorbjørn Lund Martsum <tmartsum@gmail.com>2012-08-10 15:24:33 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-10 09:26:31 +0200
commit692e642305e2c24883645bd56db491d031e97252 (patch)
treeb1d5d522b9c50aa4b0bf99e2c2d8f05ac915176c /src/widgets/kernel/qsizepolicy.h
parentc92d1d8acdfb125ce8abfcd996ac151437e6f31d (diff)
QSizePolicy - add retainSizeWhenHidden
Sometimes it is nice that hiding a widget does not affect the layout. This patch makes that possible by allowing hidden widgets to take up space. Change-Id: Ifbc1cdee0e112950acc025919b98199ea9558db7 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Diffstat (limited to 'src/widgets/kernel/qsizepolicy.h')
-rw-r--r--src/widgets/kernel/qsizepolicy.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/widgets/kernel/qsizepolicy.h b/src/widgets/kernel/qsizepolicy.h
index 2fe85cbe0c..9c6d67410a 100644
--- a/src/widgets/kernel/qsizepolicy.h
+++ b/src/widgets/kernel/qsizepolicy.h
@@ -131,6 +131,9 @@ public:
void setHorizontalStretch(int stretchFactor) { bits.horStretch = static_cast<quint32>(qBound(0, stretchFactor, 255)); }
void setVerticalStretch(int stretchFactor) { bits.verStretch = static_cast<quint32>(qBound(0, stretchFactor, 255)); }
+ bool retainSizeWhenHidden() const { return bits.retainSizeWhenHidden; }
+ void setRetainSizeWhenHidden(bool retainSize) { bits.retainSizeWhenHidden = retainSize; }
+
void transpose();
@@ -150,7 +153,7 @@ private:
quint32 ctype : 5;
quint32 hfw : 1;
quint32 wfh : 1;
- quint32 padding : 1; // feel free to use
+ quint32 retainSizeWhenHidden : 1;
} bits;
quint32 data;
};