Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
windowcapturesnippets.cpp
Go to the documentation of this file.
1
// Copyright (C) 2026 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4
#
include
<
QCapturableWindow
>
5
#
include
<
QMediaCaptureSession
>
6
#
include
<
QVideoWidget
>
7
#
include
<
QWindowCapture
>
8
9
void
wrapper0
() {
10
11
//! [Basic setup]
12
QMediaCaptureSession session;
13
QWindowCapture windowCapture;
14
session.setWindowCapture(&windowCapture);
15
16
QVideoWidget videoWidget;
17
session.setVideoOutput(&videoWidget);
18
videoWidget.show();
19
20
// A window must be selected before capturing can start.
21
const
QList<QCapturableWindow> windows = QWindowCapture::capturableWindows();
22
if
(!windows.isEmpty()) {
23
windowCapture.setWindow(windows.first());
24
windowCapture.start();
25
}
26
//! [Basic setup]
27
28
}
// wrapper0()
wrapper0
void wrapper0()
Definition
screencapturesnippets.cpp:8
qtmultimedia
src
multimedia
doc
snippets
multimedia-snippets
windowcapturesnippets.cpp
Generated on
for Qt by
1.18.0