[Interest] creating Networks of QGraphicsItems

Philipp Menke philipp.menke at freenet.de
Thu Aug 16 23:10:31 CEST 2012


Hi

I want to write a Program to simulate electric networks. The (higher) 
math of Multi-dimensional Newton and ODEs is no problem but the 
WYSIWYG-like-network-editor:


I subclassed QGraphicItem for the various types of Nodes in such a 
Network (resistors, inductors, capacitors) and for the cables. Having 
two nodes connected with a cable looks good as long as i leave them on 
the position they have been that time.
The Node-Items are set selectable and movable. When i move a connected 
one, the cable does not get repainted every time.
I tried to ensure this by overloading update(QRectF) for the Nodes but 
it did not change anything.
I thought of "hinting" the cable in the nodes, and let one of the 
connected ones draw the connection, but it won't work if just the other 
one gets moved.

Every hint/idea is welcome

Philipp



More information about the Interest mailing list