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"
8
#
include
"qimagecapture.h"
9
10
/* Globals so that everything is consistent. */
11
QCamera
*camera = 0;
12
QImageCapture
*
imageCapture
= 0;
13
QVideoWidget
*
viewfinder
= 0;
14
15
void
camera_blah
()
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
}
QCamera
The QCamera class provides interface for system camera devices.
Definition
qcamera.h:25
viewfinder
QVideoWidget * viewfinder
Definition
camera.cpp:22
camera_blah
void camera_blah()
Definition
camera.cpp:171
imageCapture
QImageCapture * imageCapture
Definition
camera.cpp:21
qtmultimedia
src
multimediawidgets
doc
snippets
multimedia-snippets
camera.cpp
Generated on
for Qt by
1.14.0