mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-31 09:05:14 +01:00
Fixed some possible corner case
This commit is contained in:
parent
0c4e5b0017
commit
0b3e35db72
@ -115,9 +115,6 @@ int FlowLayout::doLayout(const QRect &rect, bool testOnly) const
|
|||||||
int lineHeight = 0;
|
int lineHeight = 0;
|
||||||
QVector<QVector<FlowLayoutItem>> rows;
|
QVector<QVector<FlowLayoutItem>> rows;
|
||||||
|
|
||||||
if (!_items.isEmpty())
|
|
||||||
rows.append(QVector<FlowLayoutItem>());
|
|
||||||
|
|
||||||
for (int i = 0; i < _items.size(); i++) {
|
for (int i = 0; i < _items.size(); i++) {
|
||||||
QLayoutItem *item = _items.at(i);
|
QLayoutItem *item = _items.at(i);
|
||||||
const QWidget *wid = item->widget();
|
const QWidget *wid = item->widget();
|
||||||
@ -139,6 +136,8 @@ int FlowLayout::doLayout(const QRect &rect, bool testOnly) const
|
|||||||
rows.append(QVector<FlowLayoutItem>());
|
rows.append(QVector<FlowLayoutItem>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rows.isEmpty())
|
||||||
|
rows.append(QVector<FlowLayoutItem>());
|
||||||
rows.last().append(FlowLayoutItem(item, x, y));
|
rows.last().append(FlowLayoutItem(item, x, y));
|
||||||
|
|
||||||
x = nextX;
|
x = nextX;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user