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
qquickscreencapture_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 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#ifndef QQUICKSCREENCAPTURE_P_H
5#define QQUICKSCREENCAPTURE_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of other Qt classes. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/private/qglobal_p.h>
19
20#include <QtMultimedia/qscreencapture.h>
21
22#include <QtMultimediaQuick/qtmultimediaquickexports.h>
23
24#include <QtQml/qqml.h>
25
26#include <QtQuick/private/qquickscreen_p.h>
27
28#include <memory>
29
31
32class Q_MULTIMEDIAQUICK_EXPORT QQuickScreenCapture : public QScreenCapture
33{
34 Q_OBJECT
35 Q_PROPERTY(QQuickScreenInfo *screen READ ensureQmlScreen WRITE qmlSetScreen NOTIFY qmlScreenChanged)
36 Q_PROPERTY(qreal maximumFrameRate READ qmlMaximumFrameRate WRITE qmlSetMaximumFrameRate RESET
37 qmlResetMaximumFrameRate NOTIFY maximumFrameRateChanged REVISION(6, 12))
38 QML_NAMED_ELEMENT(ScreenCapture)
39
40public:
41 QQuickScreenCapture(QObject *parent = nullptr);
42
43 void qmlSetScreen(QQuickScreenInfo *newQmlScreen);
44
45 QQuickScreenInfo *ensureQmlScreen();
46
47 void qmlSetMaximumFrameRate(qreal);
48 qreal qmlMaximumFrameRate() const;
49 void qmlResetMaximumFrameRate();
50
51Q_SIGNALS:
52 void qmlScreenChanged(QQuickScreenInfo *);
53 Q_REVISION(6, 12) void maximumFrameRateChanged(qreal);
54
55private:
56 QPointer<QQuickScreenInfo> m_qmlScreen;
57 std::unique_ptr<QQuickScreenInfo> m_ownQmlScreen;
58};
59
60QT_END_NAMESPACE
61
62#endif // QQUICKSCREENCAPTURE_P_H
Combined button and popup list for selecting options.
static QT_BEGIN_NAMESPACE qreal screenFrameRateToReal(std::optional< qreal > frameRate)