From 0b3e35db723e5c9284df98f73ce7c165ad930fa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Thu, 5 Aug 2021 00:02:47 +0200 Subject: [PATCH] Fixed some possible corner case --- src/GUI/flowlayout.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/GUI/flowlayout.cpp b/src/GUI/flowlayout.cpp index 39938b8c..025f8897 100644 --- a/src/GUI/flowlayout.cpp +++ b/src/GUI/flowlayout.cpp @@ -115,9 +115,6 @@ int FlowLayout::doLayout(const QRect &rect, bool testOnly) const int lineHeight = 0; QVector> rows; - if (!_items.isEmpty()) - rows.append(QVector()); - for (int i = 0; i < _items.size(); i++) { QLayoutItem *item = _items.at(i); const QWidget *wid = item->widget(); @@ -139,6 +136,8 @@ int FlowLayout::doLayout(const QRect &rect, bool testOnly) const rows.append(QVector()); } + if (rows.isEmpty()) + rows.append(QVector()); rows.last().append(FlowLayoutItem(item, x, y)); x = nextX;