Important: Please read the Qt Code of Conduct -

QCameraViewfinder: How to remove last frame after disconnection

  • I hava a QCameraViewfinder connected to
    a QCamera. After the device disconnection, the
    last received frame still in the viewfinder.
    How can I make the app reset the viewfinder
    to a Black Screen automatically? There are signals for this? Or properties?

    Thanks in advice.

  • from your QCameraViewfinder object, get the QMediaObject pointer.

    [virtual] QMediaObject *mediaObject() const

    then, from this pointer get the QMediaService * pointer.

    [virtual] QMediaService *QMediaObject::service() const

    This pointer gives you access to the mediaplayer controle

    QMediaPlayerControl *control = qobject_cast<QMediaPlayerControl *>(

    Maybe this is what you are looking for


Log in to reply