Prevent closing of tab when tab closeButton mouseReleaseEvent occurs outside of the button rect.

svn path=/trunk/KDE/kdebase/workspace/; revision=1072363
This commit is contained in:
Hugo Pereira Da Costa 2010-01-10 03:29:07 +00:00
parent b90acadcc9
commit e2bd296cf7

View file

@ -1251,7 +1251,8 @@ namespace Oxygen
if( widget() == object ) state = mouseReleaseEvent( static_cast< QMouseEvent* >( event ) ); if( widget() == object ) state = mouseReleaseEvent( static_cast< QMouseEvent* >( event ) );
else if( OxygenButton *btn = qobject_cast< OxygenButton* >( object ) ) else if( OxygenButton *btn = qobject_cast< OxygenButton* >( object ) )
{ {
if( static_cast< QMouseEvent* >( event )->button() == Qt::LeftButton ) QMouseEvent* mouseEvent( static_cast< QMouseEvent* >( event ) );
if( mouseEvent->button() == Qt::LeftButton && btn->rect().contains( mouseEvent->pos() ) )
{ state = closeItem( btn ); } { state = closeItem( btn ); }
} }