38 CapturingNotSupported = 2,
43 using ScreenSource = QPointer<QScreen>;
44 using WindowSource = QCapturableWindow;
46 using Source = std::variant<ScreenSource, WindowSource>;
48 explicit QPlatformSurfaceCapture(Source initialSource);
50 void setActive(
bool active) override;
51 bool isActive()
const override;
53 void setSource(Source source);
55 template<
typename Type>
57 Q_ASSERT(std::holds_alternative<Type>(m_source));
58 return *std::get_if<Type>(&m_source);
61 Source source()
const {
return m_source; }
64 QString errorString()
const final;
66 void setFrameRate(std::optional<qreal>);
67 [[nodiscard]] std::optional<qreal> frameRate()
const;
69 void setIgnoreCursor(
bool);
71 [[nodiscard]]
bool ignoreCursor()
const;
73 void setIgnoreDropShadow(
bool);
75 [[nodiscard]]
bool ignoreDropShadow()
const;
78 virtual bool setActiveInternal(
bool) = 0;
80 bool checkScreenWithError(ScreenSource &screen);
83 void updateError(Error error,
const QString &errorString);
86 void sourceChanged(WindowSource);
87 void sourceChanged(ScreenSource);
88 void errorOccurred(Error error, QString errorString);
89 void frameRateChanged(std::optional<qreal>);
92 std::optional<qreal> m_frameRate;
93 QErrorInfo<Error> m_error;
95 bool m_active =
false;
99 bool m_ignoreCursor =
false;
100 bool m_ignoreDropShadow =
false;