I need a simple QT example to trigger a function in the main-thread by a signal from QThread. Use the Signal/Slot principle.
As the base, just use in QT-Creator the standard QWidget application (QMainWindow).
1. start a new QThread.
2. in the QThread start a while(1) loop that should trigger every 3 seconds a funktion call in the MainThread.
3. The function in the MainThread is triggert by the trigger in the while(1) loop in the Qthread. This update the lable on [url removed, login to view]
int count = 0; // counted label updates
// The loop in the QThread:
// trigger the function in Main-Thread here !
// The function in the mainwindow-Thread(mainwindow):
ui→label→setText(count); // update the label
Thank you for looking, I look forward to hearing from you
Është zgjedhur fitues:
9 profesionistë freelancer dërguan një ofertë mesatare prej €18 për këtë punë
Hi there, We can help you. This is quite a simple assignment. We have been working with Qt for more than 5 years. Looking forward to working with you. Thanks and best regards,