Yuk. This has kinda opened a can of worms. I can't do the rubber band detection in the scene's mouse events, because when the mouse is over one of my items, I don't get mouse move events in the scene ( I guess I need to differentiate between mouse drags and mouse moves).
But anyway, I moved the code to the view, and now I get the mouse move events, but sometimes randomly I will not receive a mouse release event in the QGraphicsView. So if I drag the rubberband at a certain speed and then release the mouse button the view doesn't get the event and never hides the rubber band.
Also drawing of the rubberband is different than using the built in dragMode. Somehow it seems to draw a white rectangle first, and then repaint it with the dashed line a moment later. This might be a linux issue. Performance of this has always been terrible under linux, but I don't understand why the drawing would be different. Looks like the built in rubber band has some other hacks that I'm not doing... Maybe I'll just stick with that for now.. But this should really be easier than it is.





Reply With Quote
Bookmarks