Results 1 to 3 of 3

Thread: Qgraphicsscene/view connection line avoiding collision with other grapicsitems

  1. #1
    Join Date
    May 2013
    Posts
    24
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Qgraphicsscene/view connection line avoiding collision with other grapicsitems

    Hi,

    I want to connect two graphicsitems with a line in a graphicsscene. Right now, all I have is a straight line between the items. But I want to make the line go around other items in the view. It is OK for the line to cross another line.

    Is there a standard way to do this in QT?

    I have been thinking to use QGraphicsPathItem instead of the QGraphicsLineItem that I'm currently using for the line. But how do I choose the best way to route the line?


    Thanks!

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

    Default Re: Qgraphicsscene/view connection line avoiding collision with other grapicsitems

    Quote Originally Posted by salcin View Post
    I have been thinking to use QGraphicsPathItem instead of the QGraphicsLineItem that I'm currently using for the line. But how do I choose the best way to route the line?
    You need to implement an algorithm that calculates the route. This has nothing to do with Qt.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    May 2013
    Posts
    24
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qgraphicsscene/view connection line avoiding collision with other grapicsitems

    That was my suspicion. Thanks for the confirmation.

Similar Threads

  1. Replies: 0
    Last Post: 23rd March 2013, 14:50
  2. Replies: 1
    Last Post: 27th January 2013, 18:42
  3. Widget collision in QGraphicsScene
    By Rodrigo Alves in forum Newbie
    Replies: 2
    Last Post: 21st November 2012, 16:53
  4. Collision detect in QGraphicsScene
    By sophister in forum Qt Programming
    Replies: 6
    Last Post: 5th December 2009, 02:38
  5. A connection line
    By baray98 in forum Qt Programming
    Replies: 1
    Last Post: 17th November 2008, 09:44

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
  •  
Qt is a trademark of The Qt Company.