9

I was wondering if there was a nice way to allow users to create nodal graphs (with restrictions) as with LabView.

Something like this:

Example

I have seen http://www.pyqtgraph.org/, which seems to have something similar, and I do intend to use PyQt as my base (though I do not mind linking in C++ code), but it doesn't quite have the look and feel I wanted.

Any pointers to the right direction would be great.

misterManSam
  • 24,303
  • 11
  • 69
  • 89
Cenoc
  • 11,172
  • 21
  • 58
  • 92
  • 3
    I know this has been long time, but just want to check with you if you have found a good solution. thanks. – james Sep 13 '16 at 12:54

2 Answers2

2

There is a Diagram Scene Example which uses the Graphics View framework to make flowchart diagrams. It is an application in which you can add flowchart shapes and text and connect the shapes by arrows. The shapes, arrows, and text can be given different colors, and it is possible to change the font, style, and underline of the text.

You can take a look at the code and see how to create custom graphics items and handle mouse events and movement of items. Then change the look and behavior as you like.

Check another diagram editor here.

Nejat
  • 31,784
  • 12
  • 106
  • 138
2

[not enough reps. to comment]I too had a similar task to implement. For me it was a large and complex block diagram. It was really hard to implement using QGraphicsScene. I posted a question on SO and instantly gained enough downvotes. No one gave any useful hints. So I did the hardway. Created images of lines with transparent background and changed the style-sheet dynamically. I don't know weather this is the right way. It will be really helpful if someone gave insights on this.

sreagm
  • 378
  • 2
  • 10