此類用於捕獲窗口。 更多...
| 頭: |
#include <QWindowCapture>
|
| CMake: |
find_package(Qt6 REQUIRED COMPONENTS Multimedia)
target_link_libraries(mytarget PRIVATE Qt6::Multimedia)
|
| qmake: |
QT += multimedia
|
| Since: | Qt 6.6 |
| 在 QML: | WindowCapture |
| 繼承: | QObject |
| enum | Error { NoError, InternalError, CapturingNotSupported, CaptureFailed, NotFound } |
| QWindowCapture (QObject * parent = nullptr) | |
| virtual | ~QWindowCapture () override |
| QWindowCapture::Error | error () const |
| QString | errorString () const |
| bool | isActive () const |
| void | setWindow (QCapturableWindow window ) |
| QCapturableWindow | window () const |
| void | setActive (bool active ) |
| void | start () |
| void | stop () |
| void | activeChanged (bool) |
| void | errorChanged () |
| void | errorOccurred (QWindowCapture::Error error , const QString & errorString ) |
| void | windowChanged (QCapturableWindow window ) |
| QList<QCapturableWindow> | capturableWindows () |
The class captures a window. It is managed by the QMediaCaptureSession class where the captured window can be displayed in a video preview object or recorded to a file.
The following limitations apply to using QWindowCapture:
另請參閱 QMediaCaptureSession and QCapturableWindow .
Enumerates error codes that can be signaled by the QWindowCapture 類。 errorString () provides detailed information about the error cause.
| 常量 | 值 | 描述 |
|---|---|---|
QWindowCapture::NoError
|
0
|
沒有錯誤 |
QWindowCapture::InternalError
|
1
|
Internal window capturing driver error |
QWindowCapture::CapturingNotSupported
|
2
|
Window capturing is not supported |
QWindowCapture::CaptureFailed
|
4
|
Capturing window failed |
QWindowCapture::NotFound
|
5
|
Selected window not found |
此特性保持捕獲目前是否活動。
訪問函數:
| bool | isActive () const |
| void | setActive (bool active ) |
通知程序信號:
| void | activeChanged (bool) |
[read-only]
error
: const
Error
This property holds the code of the last error.
訪問函數:
| QWindowCapture::Error | error () const |
通知程序信號:
| void | errorChanged () |
[read-only]
errorString
: const
QString
This property holds a human readable string describing the cause of error.
訪問函數:
| QString | errorString () const |
通知程序信號:
| void | errorChanged () |
This property holds the window for capturing.
訪問函數:
| QCapturableWindow | window () const |
| void | setWindow (QCapturableWindow window ) |
通知程序信號:
| void | windowChanged (QCapturableWindow window ) |
另請參閱 QWindowCapture::capturableWindows .
[explicit]
QWindowCapture::
QWindowCapture
(
QObject
*
parent
= nullptr)
構造新 QWindowCapture 對象采用 parent .
[override virtual noexcept]
QWindowCapture::
~QWindowCapture
()
銷毀對象。
[static invokable]
QList
<
QCapturableWindow
> QWindowCapture::
capturableWindows
()
Returns a list of QCapturableWindow objects that is available for capturing.
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
[signal]
void
QWindowCapture::
errorOccurred
(
QWindowCapture::Error
error
, const
QString
&
errorString
)
Signals when an error occurs, along with the errorString .
[slot]
void
QWindowCapture::
start
()
啓動捕獲 window .
This is equivalent to setting the active 特性為 true。
[slot]
void
QWindowCapture::
stop
()
停止捕獲。
This is equivalent to setting the active property to false.