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;
67 virtual bool setActiveInternal(
bool) = 0;
69 bool checkScreenWithError(ScreenSource &screen);
72 void updateError(Error error,
const QString &errorString);
75 void sourceChanged(WindowSource);
76 void sourceChanged(ScreenSource);
77 void errorOccurred(Error error, QString errorString);
80 QErrorInfo<Error> m_error;
82 bool m_active =
false;