QWindowCapture Class
このクラスはウィンドウをキャプチャするために使用します。詳細...
ヘッダー | #include <QWindowCapture> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Multimedia) target_link_libraries(mytarget PRIVATE Qt6::Multimedia) |
qmake: | QT += multimedia |
以来: | Qt 6.6 |
QML で | WindowCapture |
継承: | QObject |
パブリックな型
enum | Error { NoError, InternalError, CapturingNotSupported, CaptureFailed, NotFound } |
プロパティ
- active : bool
- error : const Error
- errorString : const QString
- window : QCapturableWindow
パブリック機能
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 | activeChanged(bool) |
void | errorChanged() |
void | errorOccurred(QWindowCapture::Error error, const QString &errorString) |
void | windowChanged(QCapturableWindow window) |
静的パブリックメンバ
QList<QCapturableWindow> | capturableWindows() |
詳細説明
このクラスはウィンドウをキャプチャします。QMediaCaptureSession クラスによって管理され、キャプチャされたウィンドウはビデオ プレビュー オブジェクトに表示されるか、ファイルに記録されます。
ウィンドウ キャプチャの制限事項
QWindowCaptureの使用には以下の制限があります:
- QWindowCapture は FFmpeg バックエンドでのみサポートされています。
QMediaCaptureSession およびQCapturableWindowも参照してください 。
メンバ タイプ ドキュメント
enum QWindowCapture::Error
QWindowCapture クラスがシグナルできるエラーコードを列挙します。errorString() は、エラーの原因に関する詳細情報を提供します。
定数 | 値 | 説明 |
---|---|---|
QWindowCapture::NoError | 0 | エラーなし |
QWindowCapture::InternalError | 1 | 内部ウィンドウキャプチャドライバエラー |
QWindowCapture::CapturingNotSupported | 2 | ウィンドウのキャプチャはサポートされていません |
QWindowCapture::CaptureFailed | 4 | ウィンドウのキャプチャに失敗しました |
QWindowCapture::NotFound | 5 | 選択されたウィンドウが見つからない |
プロパティ ドキュメント
active : bool
このプロパティは、キャプチャが現在アクティブであるかどうかを保持する。
アクセス関数
bool | isActive() const |
void | setActive(bool active) |
Notifierシグナル:
void | activeChanged(bool) |
[read-only]
error : const Error
このプロパティは、最後のエラーのコードを保持する。
アクセス関数
QWindowCapture::Error | error() const |
通知シグナル
void | errorChanged() |
[read-only]
errorString : const QString
このプロパティは、エラーの原因を説明する可読文字列を保持する。
アクセス関数
QString | errorString() const |
通知シグナル
void | errorChanged() |
window : QCapturableWindow
このプロパティは、キャプチャ用のウィンドウを保持する。
アクセス関数
QCapturableWindow | window() const |
void | setWindow(QCapturableWindow window) |
ノーティファイアシグナル:
void | windowChanged(QCapturableWindow window) |
メンバ関数ドキュメント
[explicit]
QWindowCapture::QWindowCapture(QObject *parent = nullptr)
新しい QWindowCapture オブジェクトをparent で構築します。
[override virtual noexcept]
QWindowCapture::~QWindowCapture()
オブジェクトを破壊する。
[static invokable]
QList<QCapturableWindow> QWindowCapture::capturableWindows()
キャプチャ可能なQCapturableWindow オブジェクトのリストを返す。
注意: この関数はメタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[signal]
void QWindowCapture::errorOccurred(QWindowCapture::Error error, const QString &errorString)
errorString とともに、error の発生を知らせる。
[slot]
void QWindowCapture::start()
window のキャプチャを開始する。
これはactive プロパティをtrueに設定することと同じである。
[slot]
void QWindowCapture::stop()
キャプチャを停止する。
これは、active プロパティを false に設定することと同じです。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.