From 145efba57b205e1d72f1b8b32a240d18bd7d716c Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 21 Nov 2016 14:53:14 +0100 Subject: [PATCH] Only call update() in setGeometry() when it's a new rect. --- qrenderdoc/3rdparty/flowlayout/FlowLayout.cpp | 8 +++++++- qrenderdoc/3rdparty/flowlayout/FlowLayout.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/qrenderdoc/3rdparty/flowlayout/FlowLayout.cpp b/qrenderdoc/3rdparty/flowlayout/FlowLayout.cpp index 89a22b154..938585334 100644 --- a/qrenderdoc/3rdparty/flowlayout/FlowLayout.cpp +++ b/qrenderdoc/3rdparty/flowlayout/FlowLayout.cpp @@ -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 diff --git a/qrenderdoc/3rdparty/flowlayout/FlowLayout.h b/qrenderdoc/3rdparty/flowlayout/FlowLayout.h index 5d2512b52..3e822b35f 100644 --- a/qrenderdoc/3rdparty/flowlayout/FlowLayout.h +++ b/qrenderdoc/3rdparty/flowlayout/FlowLayout.h @@ -72,6 +72,7 @@ private: int smartSpacing(QStyle::PixelMetric pm) const; QList itemList; + QRect m_prevRect; bool m_fixedGrid; int m_hSpace; int m_vSpace;