Jacob
Jacob

Reputation: 1395

QCameraImageCapture() no matching function

I get the error,

error: no matching function for call to 'QCameraImageCapture::QCameraImageCapture()'

Simply by having the code,

#include <QCamera>
#include <QCameraImageCapture>

class Webcam : public QObject
{
    Q_OBJECT

public:
    Webcam();mageCaptured();

private:
    QCameraImageCapture _imageCamera;
};

I have written no other code. Any idea what's going on here? It worked for QCamera _camera;

EDIT:

Sorry, this is completely my fault. Too much time using Python made me forget all about pointers.

Upvotes: 0

Views: 224

Answers (1)

Zlatomir
Zlatomir

Reputation: 7034

QCameraImageCapture doesn't have a default constructor, see the documentation here, so you must pass a QMediaObject pointer to the constructor of QCameraImageCapture (QCamera inherits from QMediaObject so it can be used there)

Quote from documentation:

The QCameraImageCapture class is a high level images recording class. It's not intended to be used alone but for accessing the media recording functions of other media objects, like QCamera.

Upvotes: 2

Related Questions