Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QtNodeEditor library data transfer problem
Qt 6.11 is out! See what's new in the release blog

QtNodeEditor library data transfer problem

Scheduled Pinned Locked Moved Unsolved General and Desktop
node editornodethreadparallellibrary
5 Posts 2 Posters 292 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Joe von HabsburgJ Offline
    Joe von HabsburgJ Offline
    Joe von Habsburg
    wrote on last edited by Joe von Habsburg
    #1

    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

    6f85f1fc-321e-48e3-9ba5-b172a7e87c34-image.png

    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 ?

    1 Reply Last reply
    0
    • Joe von HabsburgJ Offline
      Joe von HabsburgJ Offline
      Joe von Habsburg
      wrote last edited by
      #2

      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 ?

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote last edited by
        #3

        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.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        Joe von HabsburgJ 1 Reply Last reply
        0
        • SGaistS SGaist

          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.

          Joe von HabsburgJ Offline
          Joe von HabsburgJ Offline
          Joe von Habsburg
          wrote last edited by
          #4

          @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

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote last edited by
            #5

            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.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved