Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Can signal slot used as new thread?
Abhishek2509 last edited by
Void read(buffer)// this read data every second
displayData(buffer);// display data at QT screen
)// end of function
connect(this,SIGNAL,signalData(buffer),this,SLOT(displayData(buffer));//defined in constructor
Therr is no difference in display data. But just want to know which is better in terms of processing.
Any better suggestions.....
Hi and welcome to devnet,
The rule is: do not directly modify GUI elements form a different thread. Use signals and slots to communicate.
ODБOï last edited by
Here the sender is "this" and the receiver is "this" as well, so to me this still doas not respect the rule stated by @SGaist, correct me if i'm wrong.
Also, you are useing old signal/slot syntax : https://wiki.qt.io/New_Signal_Slot_Syntax