I am trying out an example from
http://www.informit.com/store/c-plus...-9780132354165
Chap08/diagram.pro
The program compiles, but does not work as advertised. When you move the nodes, the links are supposed to move with the nodes. I used the debugger and found out that it never hits the if condition in
QVariant Node
::itemChange(GraphicsItemChange change,
{
if (change == ItemPositionChange) {
foreach (Link *link, myLinks)
link->trackNodes();
}
}
QVariant Node::itemChange(GraphicsItemChange change,
const QVariant &value)
{
if (change == ItemPositionChange) {
foreach (Link *link, myLinks)
link->trackNodes();
}
return QGraphicsItem::itemChange(change, value);
}
To copy to clipboard, switch view to plain text mode
If I take the if condition out, I sort of get to move the links, but after clicking on the graphics scene.
Any insight would be great into what the problem is.
Bookmarks