QCamera status not changing



  • Hello,
    I am trying to capture some images from my qt application.
    I have code as shown,
    @
    QList<QByteArray> device = QCamera::availableDevices();

    myCamera = new QCamera(device.at(0));
    myCamera->setParent(this);
    connect(myCamera, SIGNAL(stateChanged(QCamera::State)), this, SLOT(updateCameraState(QCamera::State)));
    connect(myCamera, SIGNAL(statusChanged(QCamera::Status)), this, SLOT(updateCameraStatus(QCamera::Status)));
    
    imgCapture = new QCameraImageCapture(myCamera);
    imgCapture->setCaptureDestination(QCameraImageCapture::CaptureToFile);
    
    myCamera->setViewfinder(ui->viewFinder);
    myCamera->setCaptureMode(QCamera::CaptureStillImage);
    myCamera->start();
    
    this->setWindowTitle("Camera");
    myCamera->searchAndLock();
    

    @
    then i check for
    @imgCapture->isAvailable()@

    it shows "true" and also camera state returns Active state.
    But when i check camera status it is always
    @QCamera::UnavailableStatus@
    and hence it's not taking images for me with
    @imgCapture->capture("abc.jpg")@
    Anybody have any idea whats missing?
    I am using Logitech Webcam c525.

    [edit : fixed typo in title, Eddy ]


Log in to reply
 

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