<table><tr><td style="">fvogt created this revision.<br />fvogt added reviewers: Frameworks, dfaure.<br />Restricted Application added a project: Frameworks.<br />fvogt requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D9830" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>QAbstractItemViews does layout in a timer event handler, to avoid unnecessary<br />
layout calculations. Changes which cause a relayout only start the timer.<br />
LayoutBlocker has the restriction that it only works if the event loop is not<br />
entered during its lifetime. Without an event loop there's no expensive<br />
relayout anyway, making the LayoutBlocker pointless in such cases.<br />
LayoutBlocker works by changing the uniformItemSizes property of the QListView<br />
to false and in the destructor back to the original value again. Those changes<br />
do not trigger a relayout in QListView, so if the QListView did a layout with<br />
uniformItemSizes set to true, it stays that way.<br />
Fix it by triggering a relayout in ~LayoutBlocker.</p>
<p>This got exposed by a change in Qt, which results in QListView doing a relayout<br />
while the LayoutBlocker is active.</p>
<p>BUG: 352776</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>kfilewidgettest_gui has proper item sizes now.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R241 KIO</div></div></div><br /><div><strong>BRANCH</strong><div><div>master</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D9830" rel="noreferrer">https://phabricator.kde.org/D9830</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/filewidgets/kfilepreviewgenerator.cpp</div></div></div><br /><div><strong>To: </strong>fvogt, Frameworks, dfaure<br /></div>