Merge pull request #8012 from CozmoP/gridfix
Qt: fix bug when grid item width > grid width
This commit is contained in:
commit
4e73be94b7
|
@ -94,6 +94,18 @@ void GridView::calculateRectsIfNecessary() const
|
|||
|
||||
const int maxWidth = viewport()->width();
|
||||
|
||||
if (m_size + m_spacing * 2 > maxWidth)
|
||||
{
|
||||
m_rectForRow[0] = QRectF(x, y, m_size, m_size);
|
||||
|
||||
for (row = 1; row < model()->rowCount(); ++row)
|
||||
{
|
||||
y += m_size + m_spacing;
|
||||
m_rectForRow[row] = QRectF(x, y, m_size, m_size);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (m_viewMode)
|
||||
{
|
||||
case Anchored:
|
||||
|
@ -154,6 +166,8 @@ void GridView::calculateRectsIfNecessary() const
|
|||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m_idealHeight = y + m_size + m_spacing;
|
||||
m_hashIsDirty = false;
|
||||
viewport()->update();
|
||||
|
|
Loading…
Reference in New Issue