QtNodeEditor library data transfer problem
-
Hello, I would like to use QtNodeEditor library . I setup the system. Classes, functions, signals and slots. Everything is working. I can transfer data node to node.
There is a problem. Firstly, I want to tell my steps.
1 - take data from tcp server
2 - transfer data with signal-slot to node
3 - push data to connected nodes.
4 - nodes calculate data
5 - nodes update ui
Step 3 is use emit for push data connected nodes and every node step by step calculating. I should not to use this way because, if my connected node size increase, total time increase.
If I do not use nodes and directly push data to obj which is comminicated with node, Time is ok, slow but ok, better then node push system.
QtConcurrent::blockingMap(list, [&data](MyObj*pc) { pc->compute(data); }); for (MyObj*pc : list) pc->render(); // render must be in main thread // or QThreadPool *pool = QThreadPool::globalInstance(); for (MyObj*pc : list){ MyObjJob *job = new MyObjJob ; job->pc = pc; job->data = &data; job->setAutoDelete(true); pool->start(job); } pool->waitForDone(); for (MyObj*pc : list) pc->render();Parallel computing is solituon.
I want to ask, There is a someone worked or still work with QtNodeEditor library and help me ?
-
I did like that but I could not be sure is it right ?
// Original void MyNode::onSendData(const QVector<float> &data) { _data= std::make_shared<Data>(); _data->data= data; emit dataUpdated(0); // Step by step for each connection } // My Edit void MyNode::onSendData(const QVector<float> &data, std::shared_ptr<AppGraphModel> &graphModel, QtNodes::NodeId &id) { _data= std::make_shared<Data>(); _data->data= data; auto conns = graphModel->connections(id, QtNodes::PortType::Out, 0); QList<QtNodes::ConnectionId> connList(conns.begin(), conns.end()); QtConcurrent::map(connList, [&](const QtNodes::ConnectionId &conn) { auto *node = graphModel->delegateModel<QtNodes::NodeDelegateModel>(conn.inNodeId); if (node) node->setInData(_data, conn.inPortIndex); }).waitForFinished(); }Does nobody use QtNodeEditor lib ?
-
Hi,
You should try to contact the library's author(s).
I never heard of it before you mentioned it so it might also be the case of other current active forum contributors.
-
Hi,
You should try to contact the library's author(s).
I never heard of it before you mentioned it so it might also be the case of other current active forum contributors.
@SGaist said in QtNodeEditor library data transfer problem:
never heard of it before you mentioned it so it might also be the case of other current active forum contributors.
Thank you for your advice, I use lots of library with Qt and, sometimes I do not know what I will do
-
There's quite a lot of libraries using Qt and one of the pitfall is that even if there's Qt in the name it does not make them an official Qt module nor a supported Qt library.
However, it is still valid to ask questions about them here as there might be a chance that one, or more, forum members might have experience with it.