1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-01-31 00:55:13 +01:00

Fixed some possible corner case

This commit is contained in:
Martin Tůma 2021-08-05 00:02:47 +02:00
parent 0c4e5b0017
commit 0b3e35db72

View File

@ -115,9 +115,6 @@ int FlowLayout::doLayout(const QRect &rect, bool testOnly) const
int lineHeight = 0;
QVector<QVector<FlowLayoutItem>> rows;
if (!_items.isEmpty())
rows.append(QVector<FlowLayoutItem>());
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<FlowLayoutItem>());
}
if (rows.isEmpty())
rows.append(QVector<FlowLayoutItem>());
rows.last().append(FlowLayoutItem(item, x, y));
x = nextX;