Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. signal into loop
Forum Updated to NodeBB v4.3 + New Features

signal into loop

Scheduled Pinned Locked Moved Unsolved QtWebEngine
3 Posts 2 Posters 315 Views 2 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.
  • elicatE Offline
    elicatE Offline
    elicat
    wrote on last edited by
    #1

    Greetings,
    I have a method that, based on some conditions, executes a signal that changes the style of an object (in my case a paramquery grid row).
    checking through console.log I noticed that the signals are executed in correct sequence but all together at the end of the method.
    I thought that when it executes a signal it was executed instantly... where am I wrong?

    EXAMPLE

    for (int i = 0; i < arrayDataRowLauncher.size(); i++) {
       . . . .
        if (fileFinish.exists()) {
            rowStyle["background-color"] = "#98fb98";
            rowStyle["color"] = "#FFFFFF";  
            jsonObjectDataRowLauncher["pq_rowstyle"] = rowStyle;
        } else {
            rowStyle["background-color"] = "yellow";
            rowStyle["color"] = "black";  
            jsonObjectDataRowLauncher["pq_rowstyle"] = rowStyle;
        }
        emit elabSignal(jsonObjectDataRowLauncher);
    }
    

    Saluti, Gianfranco Elicat

    SGaistS 1 Reply Last reply
    0
    • elicatE elicat

      Greetings,
      I have a method that, based on some conditions, executes a signal that changes the style of an object (in my case a paramquery grid row).
      checking through console.log I noticed that the signals are executed in correct sequence but all together at the end of the method.
      I thought that when it executes a signal it was executed instantly... where am I wrong?

      EXAMPLE

      for (int i = 0; i < arrayDataRowLauncher.size(); i++) {
         . . . .
          if (fileFinish.exists()) {
              rowStyle["background-color"] = "#98fb98";
              rowStyle["color"] = "#FFFFFF";  
              jsonObjectDataRowLauncher["pq_rowstyle"] = rowStyle;
          } else {
              rowStyle["background-color"] = "yellow";
              rowStyle["color"] = "black";  
              jsonObjectDataRowLauncher["pq_rowstyle"] = rowStyle;
          }
          emit elabSignal(jsonObjectDataRowLauncher);
      }
      
      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What is connect to that signal ?
      How is it connected ?
      Do they live in the same thread ?

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

      elicatE 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        What is connect to that signal ?
        How is it connected ?
        Do they live in the same thread ?

        elicatE Offline
        elicatE Offline
        elicat
        wrote on last edited by
        #3

        @SGaist Hello,
        Be patient and remember that I am self-taught and that I am only using qt/c++/qml/qwebengine in one project, therefore with little possibility of professional growth in this area.

        The signal is connect into QWebChannel

        window.onload = function () {
            new QWebChannel(qt.webChannelTransport, function (channel) {
                 webobj = channel.objects.wiseMan;
            }
        }
        

        I couldn't figure out how to get a method or signal to run in a new threads.
        I tried this way, where EngineIndexHtml is class which contains the declare of signal

        EngineIndexHtml* workerEngineIndexHtml;
        QThread workerThreadEngineIndexHtml;
        workerThreadEngineIndexHtml.moveToThread(&workerThreadEngineIndexHtml);
        connect(workerEngineIndexHtml, &EngineIndexHtml::elabSignal, this, &EngineIndexHtml::elabSignal);
        // Starting the worker thread
        workerThreadEngineIndexHtml.start();
        emit elabSignal(jsonObjectDataRowLauncher);
        

        But i have this wrong and I didn't know how to solve it, I probably misunderstood how to run a new thread

        QThread: Destroyed while thread is still running
        

        Saluti, Gianfranco Elicat

        1 Reply Last reply
        0

        • Login

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