Skip to content

Commit

Permalink
Fixed an issue in TabWidget's artwork tabs autosize function that mak…
Browse files Browse the repository at this point in the history
…es gdb crash

with SIGFPE.
  • Loading branch information
Cyrille Bollu committed Feb 25, 2016
1 parent 7aad86e commit d9edef3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/gui/widgets/TabWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{

Expand Down

0 comments on commit d9edef3

Please sign in to comment.