diff options
Diffstat (limited to 'src/widgets/kernel/qgridlayout.cpp')
-rw-r--r-- | src/widgets/kernel/qgridlayout.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/widgets/kernel/qgridlayout.cpp b/src/widgets/kernel/qgridlayout.cpp index b58e7fdc9e..29df38f19c 100644 --- a/src/widgets/kernel/qgridlayout.cpp +++ b/src/widgets/kernel/qgridlayout.cpp @@ -746,9 +746,13 @@ void QGridLayoutPrivate::setupSpacings(QVector<QLayoutStruct> &chain, if (orientation == Qt::Vertical) { QGridBox *sibling = vReversed ? previousBox : box; if (sibling) { - QWidget *wid = sibling->item()->widget(); - if (wid) - spacing = qMax(spacing, sibling->item()->geometry().top() - wid->geometry().top() ); + if (sibling->item()->isEmpty()) { + spacing = 0; + } else { + QWidget *wid = sibling->item()->widget(); + if (wid) + spacing = qMax(spacing, sibling->item()->geometry().top() - wid->geometry().top()); + } } } } |