diff options
authorJan Arve Saether <>2014-01-21 09:57:50 +0100
committerThe Qt Project <>2014-01-22 12:19:39 +0100
commit7ddd813b7f4a7c68047f4296247ddf7f277582b7 (patch)
parentdb51ffc0d1fbce85fd542403812fab8783c53e3c (diff)
Support negative layout spacings (do not assert)
This tests * default spacing * explicit positive spacing * negative spacings Negative spacings that causes the layout to shrink down to 0 or a negative spacing are not supported. (But make sure they don't crash the whole engine) This is a partial cherry picked from qtquickcontrols.git/bc973dcf2163b25f2db74d974b252384bbee8d80) Only the Q_ASSERT had to be cherry-picked. This is because of that the qgridlayoutengine* is moved to qtbase. Therefore, any changes to qgridlayoutengine* won't be merged properly to dev (they will be lost). Task-number: QTBUG-35741 Reviewed-by: Jens Bache-Wiig <> Change-Id: I834f1efc11aca59a93c8d870f1a776f2f8810485 Reviewed-by: Caroline Chao <>
1 files changed, 0 insertions, 1 deletions
diff --git a/src/gui/util/qgridlayoutengine.cpp b/src/gui/util/qgridlayoutengine.cpp
index be38e92f21..31f00c0601 100644
--- a/src/gui/util/qgridlayoutengine.cpp
+++ b/src/gui/util/qgridlayoutengine.cpp
@@ -805,7 +805,6 @@ int QGridLayoutEngine::effectiveLastRow(Qt::Orientation orientation) const
void QGridLayoutEngine::setSpacing(qreal spacing, Qt::Orientations orientations)
- Q_ASSERT(spacing >= 0.0);
if (orientations & Qt::Horizontal)
if (orientations & Qt::Vertical)