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
qquickwindowcapture.cpp
Go to the documentation of this file.
1
// Copyright (C) 2025 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4
#
include
"qquickwindowcapture_p.h"
5
6
QT_BEGIN_NAMESPACE
7
8
static
qreal
windowFrameRateToReal
(std::optional<qreal> frameRate)
9
{
10
return
frameRate.value_or(-1.f);
11
}
12
13
QQuickWindowCapture::QQuickWindowCapture(QObject *parent) : QWindowCapture(parent)
14
{
15
}
16
17
/*!
18
\since 6.12
19
\qmlproperty real QtMultimedia::WindowCapture::maximumFrameRate
20
21
The window capture frame rate upper limit.
22
23
This can be set to override the capture frame rate used by default based on
24
e.g. display refresh rate, but only as an upper limit since window capture
25
produces frames at a variable rate. Setting this higher than the display
26
refresh rate is not recommended and can cause errors.
27
28
If -1, a platform-dependent default is used.
29
30
Any changes to this property are applied the next time the WindowCapture
31
goes active.
32
*/
33
34
void
QQuickWindowCapture::qmlSetMaximumFrameRate(qreal frameRate)
35
{
36
if
(qFuzzyCompare(frameRate,
static_cast
<qreal>(-1.f)))
37
setMaximumFrameRate(std::nullopt);
38
else
if
(frameRate > 0.f)
39
setMaximumFrameRate(frameRate);
40
}
41
42
qreal QQuickWindowCapture::qmlMaximumFrameRate()
const
43
{
44
return
windowFrameRateToReal(maximumFrameRate());
45
}
46
47
void
QQuickWindowCapture::qmlResetMaximumFrameRate()
48
{
49
setMaximumFrameRate(std::nullopt);
50
}
51
52
QT_END_NAMESPACE
53
54
#
include
"moc_qquickwindowcapture_p.cpp"
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
windowFrameRateToReal
static QT_BEGIN_NAMESPACE qreal windowFrameRateToReal(std::optional< qreal > frameRate)
Definition
qquickwindowcapture.cpp:8
qtmultimedia
src
multimediaquick
qquickwindowcapture.cpp
Generated on
for Qt by
1.16.1