signal into loop
-
wrote on 22 Apr 2024, 17:36 last edited by
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); }
-
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); }
Hi,
What is connect to that signal ?
How is it connected ?
Do they live in the same thread ? -
Hi,
What is connect to that signal ?
How is it connected ?
Do they live in the same thread ?wrote on 23 Apr 2024, 06:53 last edited by@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 signalEngineIndexHtml* 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
1/3