I am trying to follow the Quick Start guide and have run into a few issues.
I am able to add blocks in code and all is well until I try to add a connector. I successfully add the connector ( no exceptions generated ) but it never gets drawn. Can you tell me what I am missing?
const double GS = BLOCKMOD::Globals::GridSpacing;
BLOCKMOD::Block b;
b.m_name = "blk_0"; // give it a name
b.m_size = QSizeF(5*GS, 10*GS); // size - aligned to grid
b.m_pos = QPointF(20*GS, 5*GS); // position - aligned to grid
// add an inlet socket to the left of the block
BLOCKMOD::Socket s;
s.m_name = "in_0";
s.m_inlet = true;
s.m_pos = QPointF(0, 2*GS);
s.m_orientation = Qt::Horizontal;
b.m_sockets.append(s);
// add an outlet socket to the right
BLOCKMOD::Socket s2("out_0", QPointF(b.m_size.width(), 2*GS), Qt::Horizontal, false);
b.m_sockets.append(s2);
// finally add the block to the managed network
networkManager->addBlock(b);
// add another block
b.m_pos = QPointF(40*GS, 5*GS); // position - aligned to grid
b.m_name = "blk_1"; // give it a name
networkManager->addBlock(b);
BLOCKMOD::Connector con;
con.m_name = QString("con1");
con.m_sourceSocket = QString("blk_0.out_0");
con.m_targetSocket = QString("blk_1.in_0");
networkManager->addConnector(con);