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
screencapturesnippets.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 <QMediaCaptureSession>
5#include <QScreenCapture>
6#include <QVideoWidget>
7
8void wrapper0()
9{
10
11//! [Basic setup]
12QMediaCaptureSession session;
13QScreenCapture screenCapture;
14session.setScreenCapture(&screenCapture);
15
16QVideoWidget videoWidget;
17session.setVideoOutput(&videoWidget);
18videoWidget.show();
19
20// With no screen set, the primary screen is captured once capturing starts.
21screenCapture.start();
22//! [Basic setup]
23
24} // wrapper0()
void wrapper0()