[SOLVED] pushButton causing my program to freeze
-
So , I have finally managed to get my pushButton1 to produce a sine wave. Thanks to everybody for your help so far.
I have now run into a new problem. once I click my pushButton1, a sine wave us generated but my window becomes unresponsive i.e.(its frozen so I can't push any other buttons). My wish is to be to stop the sine wave from running with my other pushButton2, but since it freezes the moment I push the pushButton1, I can't do this. I think it is because my program goes on a never ending while loop.
So my question is: How would I terminate this while loop with the click of pushButton2? -
I have seen your previous thread, to me it seems that you need to understant a bit a about concurrent programming, inter process communication, process, threads, dead locks, race conditions and how they work inside Qt. If you call a loop like the one you did, it will freeze the entire Program.
Take a look at the documentation, examples and videos for programming using several threads and concurrent programming. -
[quote author="VitorAMJ" date="1313007469"]I have seen your previous thread, to me it seems that you need to understant a bit a about concurrent programming, inter process communication, process, threads, dead locks, race conditions and how they work inside Qt. If you call a loop like the one you did, it will freeze the entire Program.
Take a look at the documentation, examples and videos for programming using several threads and concurrent programming.[/quote]Will do. Thanks
-
Thanks guys. Use of threads is the solution to this.
Solution is on this post: http://developer.qt.nokia.com/forums/viewthread/8745/