<table><tr><td style="">kossebau added a comment.
</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/D15625">View Revision</a></tr></table><br /><div><div><p>Looks good to me in general,  from what I tested works as intended (though I cannot test the crash as before, never had it reproduced)<br />
Some code tweaking might be nice to have, see inline comments.</p>

<p>When it comes to updating the spacing on style changes, something like this should work:</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">void IdealButtonBarLayout::changeEvent(QEvent* event)
{
    QBoxLayout::changeEvent(event);
    if (event->type() == QEvent::StyleChange) {
        setSpacing(buttonSpacing());
    }
}</pre></div></div></div><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15625#inline-85333">View Inline</a><span style="color: #4b4d51; font-weight: bold;">ideallayout.cpp:50</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"><span class="bright"></span><span style="color: #aa4000"><span class="bright">void</span></span><span class="bright"> </span><span class="n">IdealButtonBarLayout</span><span style="color: #aa2211">::<span class="bright"></span></span><span class="bright"></span><span class="n"><span class="bright">setHeight</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">int</span></span><span class="bright"> </span><span class="n"><span class="bright">height</span></span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span class="n">IdealButtonBarLayout</span><span style="color: #aa2211">::<span class="bright">~</span></span><span class="bright"></span><span class="n"><span class="bright">IdealButtonBarLayout</span></span><span class="bright"></span><span class="p"><span class="bright">(</span>)</span>
</div><div style="padding: 0 8px; margin: 0 4px; "><span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">    <span class="n">Q_ASSERT</span><span class="p">(</span><span class="n">orientation</span><span class="p">()</span> <span style="color: #aa2211">==</span> <span class="n">Qt</span><span style="color: #aa2211">::</span><span class="n">Vertical</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">    <span class="n">_height</span> <span style="color: #aa2211">=</span> <span class="n">height</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">    <span class="p">(</span><span style="color: #aa4000">void</span><span class="p">)</span> <span class="n">invalidate</span><span class="p">();</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;"><tt style="background: #ebebeb; font-size: 13px;">IdealButtonBarLayout::~IdealButtonBarLayout() = default;</tt> please</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15625#inline-85329">View Inline</a><span style="color: #4b4d51; font-weight: bold;">idealtoolbutton.cpp:100</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="n">QStyleOptionToolButton</span> <span class="n">opt</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="n">initStyleOption</span><span class="p">(</span><span style="color: #aa2211">&</span><span class="n">opt</span><span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">We might better be safe and call <tt style="background: #ebebeb; font-size: 13px;">ensurePolished();</tt> as well here at the begin.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15625#inline-85330">View Inline</a><span style="color: #4b4d51; font-weight: bold;">idealtoolbutton.cpp:115</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span style="color: #aa4000">return</span> <span class="p">{</span><span class="n">iconWidth</span> <span style="color: #aa2211">+</span> <span style="color: #601200">1</span><span class="p">,</span> <span class="n">iconHeight</span> <span style="color: #aa2211">+</span> <span style="color: #601200">1</span><span class="p">};</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="p">}</span> <span style="color: #aa4000">else</span> <span class="p">{</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Why the +1 ? To make up for any stuff style adds?</p>

<p style="padding: 0; margin: 8px;">For that it might be better in any case to do at the end of the method some call like</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">sizeHint = style()->sizeFromContents(QStyle::CT_ToolButton, &opt, QSize(w, h), this).
expandedTo(QApplication::globalStrut());</pre></div>

<p style="padding: 0; margin: 8px;">Cmp. also implemenation of QToolButton::sizeHint()  e.g. to be seen at <a href="https://code.woboq.org/qt5/qtbase/src/widgets/widgets/qtoolbutton.cpp.html#_ZNK11QToolButton8sizeHintEv" class="remarkup-link" target="_blank" rel="noreferrer">https://code.woboq.org/qt5/qtbase/src/widgets/widgets/qtoolbutton.cpp.html#_ZNK11QToolButton8sizeHintEv</a></p>

<p style="padding: 0; margin: 8px;">And yes, in a follow-up commit we should also update the <tt style="background: #ebebeb; font-size: 13px;">sizeHint()</tt> implementation to Qt5 style API.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15625#inline-85326">View Inline</a><span style="color: #4b4d51; font-weight: bold;">idealtoolbutton.cpp:116</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span style="color: #aa4000">return</span> <span class="p">{</span><span class="n">iconWidth</span> <span style="color: #aa2211">+</span> <span style="color: #601200">1</span><span class="p">,</span> <span class="n">iconHeight</span> <span style="color: #aa2211">+</span> <span style="color: #601200">1</span><span class="p">};</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="p">}</span> <span style="color: #aa4000">else</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span style="color: #74777d">// if no icon, set an arbitrary minimum size</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">No <tt style="background: #ebebeb; font-size: 13px;">else</tt> after a branch ending in <tt style="background: #ebebeb; font-size: 13px;">return</tt>, please.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15625#inline-85327">View Inline</a><span style="color: #4b4d51; font-weight: bold;">idealtoolbutton.cpp:122</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span style="color: #aa4000">return</span> <span class="n">minimumSize</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="p">}</span> <span style="color: #aa4000">else</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span style="color: #aa4000">return</span> <span class="p">{</span><span class="n">minimumSize</span><span class="p">.</span><span class="n">height</span><span class="p">(),</span> <span class="n">minimumSize</span><span class="p">.</span><span class="n">width</span><span class="p">()};</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">No <tt style="background: #ebebeb; font-size: 13px;">else</tt> after branch ending in <tt style="background: #ebebeb; font-size: 13px;">return</tt>.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15625#inline-85328">View Inline</a><span style="color: #4b4d51; font-weight: bold;">idealtoolbutton.cpp:123</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="p">}</span> <span style="color: #aa4000">else</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span style="color: #aa4000">return</span> <span class="p">{</span><span class="n">minimumSize</span><span class="p">.</span><span class="n">height</span><span class="p">(),</span> <span class="n">minimumSize</span><span class="p">.</span><span class="n">width</span><span class="p">()};</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Please <tt style="background: #ebebeb; font-size: 13px;">return minimumSize.transposed();</tt></p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R32 KDevelop</div></div></div><br /><div><strong>BRANCH</strong><div><div>segfault-fix</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D15625">https://phabricator.kde.org/D15625</a></div></div><br /><div><strong>To: </strong>amhndu, KDevelop, kossebau, rjvbb<br /><strong>Cc: </strong>kossebau, rjvbb, kdevelop-devel, glebaccon, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd<br /></div>