PDA

View Full Version : RightMouseMove Event problem



sujan.dasmahapatra
28th October 2009, 10:34
Dear Friends
I am trying to trap the rightMousemove event()

void GraphicsViewMesh::mouseMoveEvent(QMouseEvent *me)
{

if(me->button() & Qt::RightButton)
{
zoomIn();
}

}

//can anyone tell me whats wrong in this my zoomIn() function is not working !

^NyAw^
28th October 2009, 11:12
Hi,

Change this line:


if(me->button() == Qt::RightButton)


In your statment


if(me->button() & Qt::RightButton)

You are asking if "me->button()" and "Qt::RightButton" are equal to 1(or true).

trallallero
29th October 2009, 11:25
In your statment


if(me->button() & Qt::RightButton)

You are asking if "me->button()" and "Qt::RightButton" are equal to 1(or true).

Not really, he's asking if bit "Qt::RightButton" (2nd bit) of variable returned by me->button() is 1 ;)