PDA

View Full Version : Is it possible to change the cursor on a QGraphicsView?



draftpunk
25th October 2008, 18:45
I have a QGraphicsView which contains a QGraphicsScene, and I would like to change the cursor when it is over the QGraphicsView. I've tried using setCursor, but when I do this, the cursor doesn't change when it is over the client area of the view, but does when it is over the window frame or scroll bars of the view.

The funny thing is, I've noticed that the cursor will usually change properly over the QGraphicsView client area the first time, but subsequent calls to setCursor result in the cursor changing only when over the frame, as described above.

Is is necessary to unset the cursor before setting it again? Are there hidden behaviors to be aware of when changing the cursor over a QGraphicsView? Is this even possible?

Any help would be greatly appreciated.

draftpunk

wysota
25th October 2008, 19:10
Set the cursor for the view's viewport().

draftpunk
25th October 2008, 19:43
Set the cursor for the view's viewport().

That was it! Thanks! :D

draftpunk