Press and hold your mouse button over the canvas view and move the cursor![]()
Press and hold your mouse button over the canvas view and move the cursor![]()
I pressed and holded mouse button on QtCanvasView, contentsMouseMoveEvent () is generated, but I have to generate this event without pressing mouse button.
Sure, but now we know the problem is with tracking and not with posting events.Originally Posted by YuriyRusinov
Why do you reference the viewport() of the canvas view anyway? Where do you check that contentsMouseMoveEvent? On the viewport or on the view directly?
I reference to the viewport() because some documentation on QtCanvasView examples and my thread in qt-interest recommend this. I check contentsMouseMoveEvent in my class directly, using qDebug("Contents Mouse move event"). When I move mouse without pressing button, qDebug does not out anything.
You could try enabling the tracking again after you set the canvas. There is nothing in the setCanvas() source code which could directly cause such a misbehaviour, but maybe one of the methods which get called from there mess something up.
YuriyRusinov (20th April 2006)
Problem was solved by adding this->widget()->setMouseTrackine (true); and removing all others such instructions. Thanks a lot.
Bookmarks