Important: Please read the Qt Code of Conduct -

Graph (nodes, edges) Drawing in Qt

  • I need to visualize a schematic transit map of a rail network in real time using C++ (Qt/Linux). To do that first I need to read the real coordinates of track elements (tracks, crossing, signals, stations etc) from main memory and then dynamically generate the corresponding graph elements over a Cartesian plane (like the parallel lines in the example picture below). So far I was unable to implement this graph in Qt (As far as I know there is no Qt library for graph drawing!!)

    It would be highly appreciated if someone could refer me few example links/repos of similar (graph, network, circuit, mesh) solutions (other than Qt elastic-nodes example).

    ! graph)!

  • "QGraphicsView": is definitely the API you are looking for in Qt.

  • Thanks rcari :-) Actually I am looking for a closely related example solution to move forward (even if it's a circuit board drawing example).

  • I don't think there is an example you can directly use, examples are simple and serve one purpose, and that is to show you how things are done so you can do them yourself. Anyway, learning QGraphicsView is not all that hard, and when you learn it it won't be hard to implement the functionality you need.

Log in to reply