PDA

View Full Version : Diagram Painting



typhoon1978
21st October 2010, 15:46
Hi all! It's the first time I write in this great forum, I'm developing a KDE app which manages dogs genealogies, calculates some indicator like percentage of blood, inbreeding coefficient..., manages a recursive tree showing family relationships through QTreeView and so on.

Now I want to add an option which draws a pedigree diagram, I suppose in a QGraphicsScene and the possibility to be printed or exported in some common format like PDF (but this is a second step).

I tried to start something with the available Qt classes, but I thought it can be really difficult to manage a deep tree with lot of generations. I know there are lot of APIs, commonly referred as "Graph API" which can help in this.

Is there something related to Qt which can help me ?
Where can I start from ? Do you have any advice ?

Thanks in advance,
Alex

genjix
22nd October 2010, 16:40
I haven't used it but http://qwt.sourceforge.net/ looks like what you're asking for ;)

marcvanriet
1st November 2010, 23:47
Hi,

I need some sort of graph too, but didn't find one I could use in Qt. So started to write something myself. You can find it here : Mindmapping widget (http://www.qtcentre.org/threads/35243-Mindmapping-widget?p=164436).

It can handle tree-like graphs of any complexity, but is still in an infant stage. Maybe you could get some hints from it if you would want to write something yourself too.

For the output, you could also use Graphviz as an external tool. Then you need to describe your graph in the 'dot' language, and run dot to generate a bitmap that you can then use for printing or so.

Best regards,
Marc

genjix
2nd November 2010, 16:24
aha, look at the graph example in Qt. It does a network style graph which you can use.

marcvanriet
2nd November 2010, 23:11
Genjix,

What example are you talking about ? The diagramscene example doesn't have any loading or saving if that's the one you mean.

Anyway, I now also found the 'qanava' or 'libqanava' project. Seems to be abandoned though : QAnava at freshmeat (http://freshmeat.net/projects/qanava/). I have a problem building it however. jom fails on the first line in the makefile.

Best regards,
Marc