Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
camera.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4// Camera snippets
5// Extracted from src/multimedia/doc/snippets/multimedia-snippets/camera.cpp
6#include "qcamera.h"
7#include "qvideowidget.h"
9
10/* Globals so that everything is consistent. */
11QCamera *camera = 0;
14
16{
17 //! [Camera]
18 QMediaCaptureSession captureSession;
19 camera = new QCamera;
20 captureSession.setCamera(camera);
21
22 viewfinder = new QVideoWidget();
23 viewfinder->show();
24 captureSession.setVideoOutput(viewfinder);
25
26 imageCapture = new QImageCapture;
27 captureSession.setImageCapture(imageCapture);
28
29 camera->start();
30 //! [Camera]
31
32 //! [Camera keys]
33 //on shutter button pressed
34 imageCapture->capture();
35 //! [Camera keys]
36}
The QCamera class provides interface for system camera devices.
Definition qcamera.h:25
QVideoWidget * viewfinder
Definition camera.cpp:22
void camera_blah()
Definition camera.cpp:171
QImageCapture * imageCapture
Definition camera.cpp:21