Hi!

I have a tree structure that I want to display inside a widget:

Qt Code:
  1. . A
  2. / \
  3. B C
  4. / \
  5. D E
To copy to clipboard, switch view to plain text mode 

Here, each node (A...E) are represented by a widget containing some data about the node. These nodes are all drawn inside another QWidget, let's call it Parent, which acts similarly to a main window.

I have managed to create and layout the nodes nicely, but I would also like to create the edges between them. Right now, my tree display looks like:

Qt Code:
  1. . A
  2.  
  3. B C
  4.  
  5. D E
To copy to clipboard, switch view to plain text mode 

I'd like to hear from some experienced forum user; what is the best approach to draw these lines? I have found no "raw" drawing tools inside a QWidget (the Parent). Basically, if I could create an "EdgeWidget" that points from x1,y1 to x2,y2, I would be all set. But how do I create such a widget?

Thanks!

//Bobruisk