Only call update() in setGeometry() when it's a new rect.

This commit is contained in:
baldurk
2016-11-21 14:53:14 +01:00
parent 1ea3e5bcda
commit 145efba57b
2 changed files with 8 additions and 1 deletions
+7 -1
View File
@@ -130,9 +130,15 @@ int FlowLayout::heightForWidth(int width) const
void FlowLayout::setGeometry(const QRect &rect)
{
bool needUpdate = (rect != m_prevRect);
QLayout::setGeometry(rect);
doLayout(rect, false);
update();
if(needUpdate)
update();
m_prevRect = rect;
}
QSize FlowLayout::sizeHint() const
+1
View File
@@ -72,6 +72,7 @@ private:
int smartSpacing(QStyle::PixelMetric pm) const;
QList<QLayoutItem *> itemList;
QRect m_prevRect;
bool m_fixedGrid;
int m_hSpace;
int m_vSpace;