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 *>(
    mediaService->requestControl("org.qt-project.qt.mediaplayercontrol/5.0"));

    Maybe this is what you are looking for

    OveF


Log in to reply
 

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