Fixed an issue in TabWidget's artwork tabs autosize function that makes gdb crash

with SIGFPE.
This commit is contained in:
Cyrille Bollu
2016-02-25 22:30:27 +01:00
parent 7aad86efe0
commit d9edef324f

View File

@@ -252,10 +252,16 @@ void TabWidget::paintEvent( QPaintEvent * _pe )
}
p.setPen( cap_col );
// Draw all tabs
// Compute tabs' width depending on the number of tabs (only applicable for artwork tabs)
widgetStack::iterator first = m_widgets.begin();
widgetStack::iterator last = m_widgets.end();
int tab_width = ( width() - tab_x_offset ) / std::distance( first, last ); // Correct tab's width for artwork tabs
int tab_width = width();
if ( first != last )
{
tab_width = ( width() - tab_x_offset ) / std::distance( first, last );
}
// Draw all tabs
for( widgetStack::iterator it = first ; it != last ; ++it )
{