PDA

View Full Version : Mindmapping widget



marcvanriet
20th October 2010, 14:48
Hi,

I intend to write an app in which I arrange certain items graphically. Sort of like a mind map drawing. Then, when I select an item, I could e.g. show records in a database that match certain criteria.

So I would like a widget on which I can draw this, and get a signal when items are selected.

I looked at Flo (http://qt-apps.org/content/show.php/Flo?content=93199) and VYM (http://sourceforge.net/projects/vym/), but these are both really complex so it would be a lot of work to integrate them into my project.

I could start from the 'Diagram Scene' demo and add functionality to this, but then I will be spending quite a lot of time in re-implementing something that already exists, while it is not the main functionality of my application.

Does anyone have any other suggestions of a widget or class that I could integrate in my application ?

Best regards,
Marc

faldzip
20th October 2010, 15:03
Use QGraphicsView as it is item-based and you can select those items.

marcvanriet
20th October 2010, 16:36
Yes, the Diagram Scene demo and VYM and Flo indeed use a QGraphicsView and GraphicsScene and so.

But I would like to re-use some existing widget if possible.

Regards,
Marc

SixDegrees
20th October 2010, 16:42
There's no doubt that QGraphicsView/Scene/Item is the preferred way to do this. You'll basically have to reimplement everything those classes already do, or a significant portion of it.

Take an hour to read through the documentation for those classes, and to look at the demos that are availalble. They're very simple to use, and will save you a great deal of time.

marcvanriet
20th October 2010, 17:15
Hi,

I understand that.. But the drawing of the diagram is not the most important functionality of my intended application. I would rather concentrate on the other functions and use something ready-made for the diagramming.

You know, software reuse, not reinventing the weel, prioritizing features, things like that...

If no alternatives present themselves, I think I'll take a closer look at the Diagram Scene demo. Maybe I can do with what is implemented there already, and turn it into a standalone widget. Someone made an extension of the Diagram Scene demo it by the way (QDiagram (http://qt-apps.org/content/show.php/QDiagram?content=91521)).

Best regards,
Marc

tbscope
20th October 2010, 19:56
I think you can find such components here:
http://www.vcreatelogic.com/products/gcf/

marcvanriet
20th October 2010, 21:36
Hi tbscope,

The 'generic com component framework' of VCreateLogic seems to be a framework to allow different teams to collaborate on building large software applications. I don't see how this could be turned into a small widget to draw some basic charts :confused:

You are working for that company, right ;)

Regards,
Marc

tbscope
21st October 2010, 04:32
You are working for that company, right ;)
No :-)
But that's always the danger when posting links to companies.

marcvanriet
1st November 2010, 22:35
Hi,

So started making something myself. Got the basics working now : adding and deleting nodes, saving and loading (from an XML text), selecting nodes and moving them around.

For anyone interested : see the attachment.

I think it works quite nice : just an object that can be added to any graphicscene (so it doens't require its own dedicated graphics scene but handles its own functionality). Application is signalled when a node is selected.

Still so much to do : making it look much nicer, dragging nodes onto other ones to change the parent node, auto-arranging of child nodes, changing appearance node-by-node (color, font, ..), ...

Best regards,
Marc

Avery
15th November 2010, 12:49
Hi,

I would like to have a look at your attachment.

What kind of file format is this?

After unzipping what editor/viewer could be used on windows? When i open it with notepad, i see a lot of strange symbols.

Thx for filling in the obvious...but not for me obviously.

marcvanriet
15th November 2010, 22:52
Strange... it is just a normal zip file that contains some directories with a Qt project and source code. Nothing special about it.

I can't post a message with an attachment right now. I think it has to do with the firewall settings of my router. Will post a .rar file later.

Regards,
Marc

Everall
16th November 2010, 08:37
Hi,

When I unzip it, I get a folder "Graph" with one file named "Graph", without extension.
When I unzipped that file also, I get the files you mention.

So unzipping twice works for me.

@ Marcvanriet Thanks for sharing

marcvanriet
16th November 2010, 11:54
Too bad, you can't upload a .RAR. Here's a .ZIP again, but created with 7ZIP. Please let me know if it doesn't work.

Regards,
Marc

mckelvin
25th May 2011, 15:30
Hi,

So started making something myself. Got the basics working now : adding and deleting nodes, saving and loading (from an XML text), selecting nodes and moving them around.

For anyone interested : see the attachment.

I think it works quite nice : just an object that can be added to any graphicscene (so it doens't require its own dedicated graphics scene but handles its own functionality). Application is signalled when a node is selected.

Still so much to do : making it look much nicer, dragging nodes onto other ones to change the parent node, auto-arranging of child nodes, changing appearance node-by-node (color, font, ..), ...

Best regards,
Marc

Hey , Bro ,Thanks a lot!It helps a Lot!

marcvanriet
28th May 2011, 19:55
You're welcome.

I abandoned this little project myself, so didn't add any more functionality. There is a problem with the class in that redrawing isn't done well when you change the text of a node (when the new text is shorter), but I never found out why.

Best regards,
Marc