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?