Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [SOLVED] pushButton causing my program to freeze
Forum Update on Tuesday, May 27th 2025

[SOLVED] pushButton causing my program to freeze

Scheduled Pinned Locked Moved Qt Creator and other tools
5 Posts 2 Posters 2.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    ogopa
    wrote on 10 Aug 2011, 19:44 last edited by
    #1

    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?

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VitorAMJ
      wrote on 10 Aug 2011, 20:17 last edited by
      #2

      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.

      1 Reply Last reply
      0
      • O Offline
        O Offline
        ogopa
        wrote on 10 Aug 2011, 20:25 last edited by
        #3

        [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

        1 Reply Last reply
        0
        • O Offline
          O Offline
          ogopa
          wrote on 17 Aug 2011, 20:26 last edited by
          #4

          Thanks guys. Use of threads is the solution to this.
          Solution is on this post: http://developer.qt.nokia.com/forums/viewthread/8745/

          1 Reply Last reply
          0
          • V Offline
            V Offline
            VitorAMJ
            wrote on 17 Aug 2011, 23:29 last edited by
            #5

            Great job!

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved