PDA

View Full Version : GraphicsView ignoring clicks on some objects



mooreaa
29th June 2008, 11:57
Is there a way to tell GraphicsView to pass on the mouse pressed event to the next object?

The problem is I have a basic diagram app that lets you create these shapes, I use lines as connectors to connect the shapes. When I do this, The line object is drawn on top of the objects... when I go to move the object, I'm not able to move it because the mouse is clicking withing the bounding rect of the line...

The line is really thin, but at an angle, so the bounding rect for it is HUGE relative to the line.

Maybe I need to solve the line's bounding rect issue.

Basically my goal is to create a really primitive system similar to MicroSoft's visio, and the connector lines are driving me nuts!

Appreciate any tips

wysota
29th June 2008, 14:19
Hit checking is done based on the shape() and not boundingRect(), so provided that the former is implemented correctly, the line shouldn't interfere.

mooreaa
29th June 2008, 23:40
Oh great! thank you!

mooreaa
1st July 2008, 08:13
Hmm, ok I am having a problem with the shape. Since my "shape" is a line, its really skinny and hard to select.

Is there a way to easy, "offset" the line to create a thicker selection region?

wysota
1st July 2008, 08:59
Sure, use a polygon as the shape instead of a line. Then you can control the thickness as you like.