JimBrown
10th May 2007, 18:35
Using: Qt 3.2.3
Hi,
I have a legacy app that defines a subclass of QCanvasView named DCanvasView. It is
used as a viewing area in the QMainWindow derived class. DCanvasView defines
its own contentsMouseMoveEvent method which changes the cursor shape to reflect current
state (three different shapes) and display mouse coordinates in the status bar.
My problem is that the cursor is changing when it enters the scroll bars; I only want it
to change when it enter the viewport. (Actually, I used MS Spy++ and found that there is
about a one-pixel frame-like border which is the parent (DCanvasView) window, and fully
contained within it is the viewport, the two scroll bars, and the cornerWidget, and the
cursor is changing when it is over that border, even prior to passing over the scrollbar.)
contentsMouseMoveEvent only fires when the cursor enters the viewport area, so I am at a
loss to explain where in the code the cursor is changing shape when it enters the non-
viewport area of the CanvasView.
Why is contentsMouseMoveEvent firing only when the cursor is in the viewport area? How
can I handle mouse moves in the non-viewport area of the CanvasView?
Thank you,
Jim Brown
Hi,
I have a legacy app that defines a subclass of QCanvasView named DCanvasView. It is
used as a viewing area in the QMainWindow derived class. DCanvasView defines
its own contentsMouseMoveEvent method which changes the cursor shape to reflect current
state (three different shapes) and display mouse coordinates in the status bar.
My problem is that the cursor is changing when it enters the scroll bars; I only want it
to change when it enter the viewport. (Actually, I used MS Spy++ and found that there is
about a one-pixel frame-like border which is the parent (DCanvasView) window, and fully
contained within it is the viewport, the two scroll bars, and the cornerWidget, and the
cursor is changing when it is over that border, even prior to passing over the scrollbar.)
contentsMouseMoveEvent only fires when the cursor enters the viewport area, so I am at a
loss to explain where in the code the cursor is changing shape when it enters the non-
viewport area of the CanvasView.
Why is contentsMouseMoveEvent firing only when the cursor is in the viewport area? How
can I handle mouse moves in the non-viewport area of the CanvasView?
Thank you,
Jim Brown