Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QCamera program closes



  • hello people I have a doubt, I am creating a simple application that takes pictures using a webcam, but following the example set my program closes when the photo shoot ...
    I'm with version 5.2 of the Qt example "camera" work right but my program does not ...
    I am using this code below to get the pictures I have used QCamera

    QCamera *camera;
    QCameraImageCapture *imageCapture;
    

    void OF::on_Fotografar_clicked()
    {
    camera->setViewfinder(ui->imgcamera);
    ui->imgcamera->show();

    camera->setCaptureMode(QCamera::CaptureStillImage);
    camera->start();
    imageCapture->capture();
    

    }


  • Lifetime Qt Champion

    Hi,

    Do you mean crashes ?

    With the code you are showing, neither camera nor imageCapture are initialized


Log in to reply