title: qslider sliderReleased value
body: <p>I m trying to make a media player . The time status of the track is shown using QSlider. Track seek should happen when the user releases the slider somewhere on the QSlider. I had a look on the list of QSlider signals. The one that seems to fit is sliderReleased() which happens when the user releases the slider, but it does not get the latest value of where slider is. So to get sliders latest value I used sliderMoved() and stored reference.</p>
  
  <p>Signal and slot connection</p>
  
  <pre><code>connect(this-&gt;ui-&gt;songProgress, SIGNAL(sliderMoved(int)), this,
  SLOT(searchSliderMoved(int)));
  connect(this-&gt;ui-&gt;songProgress, SIGNAL(sliderReleased()), this,
  SLOT(searchSliderReleased()));
  </code></pre>
  
  <p>Functions</p>
  
  <pre><code>  void MainWindow::searchSliderMoved(int search_percent)
      {
          value=this-&gt;ui-&gt;songProgress-&gt;value();
          std::cout&lt;&lt;"Moved: Slider value"&lt;&lt;value&lt;&lt;std::endl;
      }
  </code></pre>
  
  <p>Now I am Using the "value" variable inside searchSliderReleased for seeking</p>
  
  <pre><code>void MainWindow::searchSliderReleased()
  {
      std::cout&lt;&lt;"Released: Slider value"&lt;&lt;value&lt;&lt;std::endl;
  
      emit search(value);//seek the track to location value
  }
  </code></pre>
  
  <p>But the problem with above technique is that sliderMoved signal does not give the value where the slider is dropped but it give the location from where the slider was moved. How do I obtain the value where the slider was dropped?</p>