Delete video player.



  • Hello developers.
    I' m finding problems to remove a video, when they was playing. I try stop the video using:
    @ ui->videoPlayer->stop();
    ui->videoPlayer->close();
    delete ui->videoPlayer;
    ui->videoPlayer->deleteLater();@

    but, dont work. somebody can help me?

    (sorry for my english)


  • Moderators

    @
    delete ui->videoPlayer;
    ui->videoPlayer->deleteLater();
    @

    That is definitely not a good sequence. You are calling deleteLater() on something that is not there (or, to be more precise, on a dangling pointer). Deleting stuff from UI can also be tricky. You need to take layouts into consideration (be polite: remove widget from layout before deleting). However, I doubt that is what you need or want. You should stop the video, not remove the whole widget. If that is a widget, of course - it's hard to tell from that code.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.