From 7ddd813b7f4a7c68047f4296247ddf7f277582b7 Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Tue, 21 Jan 2014 09:57:50 +0100 Subject: 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 --- src/gui/util/qgridlayoutengine.cpp | 1 - 1 file changed, 1 deletion(-) 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) q_defaultSpacings[Hor].setUserValue(spacing); if (orientations & Qt::Vertical) -- cgit v1.2.3