QSlider::handle of QMediaPlayer pull back
Solved
General and Desktop
-
If I do not drag the handle of slider quickly, the handle will pull back.
It seems I have to disconnet QMediaPlayer::positionChanged(qint64) when drag, and connect again when sliderReleased().player = new QMediaPlayer; connect(player,SIGNAL(positionChanged(qint64)),this,SLOT(positionChange(qint64))); connect(ui->sliderProgress,SIGNAL(sliderReleased()),this,SLOT(setMPPosition())); void MainWindow::positionChange(qint64 p) { ui->sliderProgress->setValue(p); } void MainWindow::setMPPosition() { player->setPosition(ui->sliderProgress->value()); }
-
Hi,
You can react on the sliderPressed signal and disable the update of the slider using a boolean variable.