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
5
7
8QQuickWindowCapture::QQuickWindowCapture(QObject *parent) : QWindowCapture(parent)
9{}
10
11/*!
12 \since 6.12
13 \qmlproperty real QtMultimedia::WindowCapture::frameRate
14
15 The target window capture framerate.
16
17 Actual frame rate depends on the platform. For platforms with fixed rate capture, this
18 frame rate is followed. For platforms with variable rate capture, this frame rate is either
19 used as the polling rate (maximum frame rate) or completely ignored.
20
21 If -1, a platform-dependent default is used.
22*/
23
24void QQuickWindowCapture::qmlSetFrameRate(qreal frameRate)
25{
26 if (qFuzzyCompare(frameRate, static_cast<qreal>(-1.f)))
27 setFrameRate(std::nullopt);
28 else if (frameRate > 0.f)
29 setFrameRate(frameRate);
30}
31
32qreal QQuickWindowCapture::qmlFrameRate() const
33{
34 return frameRate().value_or(-1.f);
35}
36
37QT_END_NAMESPACE
38
39#include "moc_qquickwindowcapture_p.cpp"
Combined button and popup list for selecting options.