PDA

View Full Version : Organisation Chart / Block Diagram



certqt
25th August 2011, 15:57
I am trying to include the ability to draw simple organisation charts and block diagrams within my application.

Does anyone have any examples / code that could give me a bit of a head start?

I have looked at the Diagram Scene example which is a good help but doesn't go quite far enough, i.e. adding pngs for the block diagram or right-angle connectors / attachment points etc.

Of course I could delve into one of the open source applications like Dia or Umbrello but I think I would get hugely lost in the complexity.

What I need is something between the two!

Thanks for any help.

marcvanriet
25th August 2011, 20:58
Hi,

I asked the same question some time ago, and looked for existing solutions, but found none.

Started to make something myself (see Mindmapping-widget (http://www.qtcentre.org/threads/35243-Mindmapping-widget?p=164436#post164436), but didn't have the time to finalize it.

Regards,
Marc

certqt
25th August 2011, 22:46
Thanks for that, it looks like a step in the right direction for me, but I am hoping for something with angled connectors etc.

ChrisW67
26th August 2011, 00:42
You could try treating the corner of each right-angled connector turn as another object connected by a simple straight line to another object. The connection between boxes A and B is via a series of lines connecting these corner objects. When your user moves a box object you would need to adjust the position of adjacent corner objects. When you user tries to move a corner object you only allow changes that do not move an adjacent box object, and also adjust any adjacent corner objects. It gets fun fast.

certqt
26th August 2011, 10:38
Thanks for the pointers. I have found yFiles for Java, pity there isn't a Qt version.