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 Update on Monday, May 27th 2025

signal into loop

Scheduled Pinned Locked Moved Unsolved QtWebEngine
3 Posts 2 Posters 251 Views
  • 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.
  • E Offline
    E Offline
    elicat
    wrote on 22 Apr 2024, 17:36 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

    S 1 Reply Last reply 22 Apr 2024, 18:17
    0
    • E elicat
      22 Apr 2024, 17:36

      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);
      }
      
      S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 22 Apr 2024, 18:17 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

      E 1 Reply Last reply 23 Apr 2024, 06:53
      0
      • S SGaist
        22 Apr 2024, 18:17

        Hi,

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

        E Offline
        E Offline
        elicat
        wrote on 23 Apr 2024, 06:53 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

        1/3

        22 Apr 2024, 17:36

        • Login

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