Need to code for printing odd and even numbers between 1 and 100 with two threads
I have a QWdiget class with two LIneEdits and a Pushbutton.
When i click on Pushbutton, two theads have to start (each one for even /odd) and update their values in corresponding lineedits.
I tried the code without locks...the odd linedit gets populated first then the even lineedit gets updated....(not parallel right).
how to make it parallel update
what do you have so far?
Basically do this:
- connect a slot to the clicked signal of the button
- in the slot start the 2 threads (there are multiple ways to create threads in Qt)
- connect each thread's (custom) signal to the QLineEdit::setText() slot
Is it some kind of exercise or what is the point to use two threads for that?