25 Q_PROPERTY(
bool active READ isActive WRITE setActive NOTIFY activeChanged)
26 Q_PROPERTY(QScreen *screen READ screen WRITE setScreen NOTIFY screenChanged)
27 Q_PROPERTY(Error error READ error NOTIFY errorChanged)
28 Q_PROPERTY(QString errorString READ errorString NOTIFY errorChanged)
29 Q_PROPERTY(std::optional<qreal> maximumFrameRate READ maximumFrameRate WRITE setMaximumFrameRate
30 NOTIFY maximumFrameRateChanged REVISION(6, 12))
36 CapturingNotSupported = 2,
42 explicit QScreenCapture(QObject *parent =
nullptr);
43 ~QScreenCapture() override;
45 QMediaCaptureSession *captureSession()
const;
47 void setScreen(QScreen *screen);
48 QScreen *screen()
const;
50 bool isActive()
const;
53 QString errorString()
const;
55 void setMaximumFrameRate(std::optional<qreal> frameRate);
56 std::optional<qreal> maximumFrameRate()
const;
59 void setActive(
bool active);
60 void start() { setActive(
true); }
61 void stop() { setActive(
false); }
64 void activeChanged(
bool);
66 void screenChanged(QScreen *);
67 void errorOccurred(QScreenCapture::Error error,
const QString &errorString);
68 Q_REVISION(6, 12)
void maximumFrameRateChanged(std::optional<qreal>);
71 void setCaptureSession(QMediaCaptureSession *captureSession);
72 QPlatformSurfaceCapture *platformScreenCapture()
const;
73 friend class QMediaCaptureSession;
74 Q_DISABLE_COPY(QScreenCapture)
75 Q_DECLARE_PRIVATE(QScreenCapture)