rem: bool hit = hitButton( e->pos() ); if ( hit ) { if ( !isDown() ) { setDown( true ); repaint( false ); emit pressed(); } } else { if ( isDown() ) { setDown( false ); repaint(); emit released(); } } }
add: if ( !(e->state() & LeftButton) && !(e->state() & MidButton) && !(e->state() & RightButton)) return;  bool hit = hitButton( e->pos() ); if ( hit ) { if ( !isDown() ) { setDown( true ); repaint( false ); emit pressed(); } } else { if ( isDown() ) { setDown( false ); repaint(); emit released(); } } }
context: 	void mouseMoveEvent( QMouseEvent *e)	{		if (!last_button)			return;			if ( !(e->state() & LeftButton) &&		     !(e->state() & MidButton) &&		     !(e->state() & RightButton))			return;    	bool hit = hitButton( e->pos() );		if ( hit )		{			if ( !isDown() )			{				setDown( true );				repaint( false );				emit pressed();			}		} else		{			if ( isDown() )			{				setDown( false );				repaint();				emit released();			}		}	}