title: QT do while loop
body: <p>I am learning QT these days and I wanted to test do while loop , the actual login works in normally, but in QT the application freezes ..
  I have defined randnum and guess in the header file ( public )</p>
  
  <pre><code>void MainWindow::on_pushButton_clicked()
  {
      srand (time(NULL));
      randnum = rand() % 10 +1;
      do {
      guess = ui-&gt;spinBox-&gt;value();
      if (guess &lt; randnum)
      {
      ui-&gt;label-&gt;setText("try something big");
      }
      else if (guess &gt; randnum)
      {
      ui-&gt;label-&gt;setText("try something small");
      }
      else
          ui-&gt;label-&gt;setText("YAY?");
  
      } while (guess != randnum);
  }
  </code></pre>
  
  <p>please tell me how to find the reason why it freezes.. thanks !</p>