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 return *q_check_ptr(std::get_if<Type>(&m_source));
60 Source source()
const {
return m_source; }
63 QString errorString()
const final;
66 virtual bool setActiveInternal(
bool) = 0;
68 bool checkScreenWithError(ScreenSource &screen);
71 void updateError(Error error,
const QString &errorString);
74 void sourceChanged(WindowSource);
75 void sourceChanged(ScreenSource);
76 void errorOccurred(Error error, QString errorString);
79 QErrorInfo<Error> m_error;
81 bool m_active =
false;