Results 1 to 5 of 5

Thread: GraphicsView ignoring clicks on some objects

  1. #1

    Default GraphicsView ignoring clicks on some objects

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: GraphicsView ignoring clicks on some objects

    Hit checking is done based on the shape() and not boundingRect(), so provided that the former is implemented correctly, the line shouldn't interfere.

  3. #3

    Default Re: GraphicsView ignoring clicks on some objects

    Oh great! thank you!

  4. #4

    Default Re: GraphicsView ignoring clicks on some objects

    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?

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: GraphicsView ignoring clicks on some objects

    Sure, use a polygon as the shape instead of a line. Then you can control the thickness as you like.

Similar Threads

  1. Ignoring zoomin/zoom out in the GraphicsView
    By maverick_pol in forum Qt Programming
    Replies: 5
    Last Post: 20th July 2007, 06:42
  2. how to corss compile for windows in Linux
    By safknw in forum Qt Programming
    Replies: 24
    Last Post: 13th May 2006, 05:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.