QWindowCapture Class

이 클래스는 창을 캡처하는 데 사용됩니다. 더 보기...

Header: #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 }

속성

공용 기능

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()

상세 설명

창을 캡처하는 클래스입니다. QMediaCaptureSession 클래스에서 관리하며, 캡처된 창을 동영상 미리보기 객체에 표시하거나 파일에 녹화할 수 있습니다.

창 캡처 제한 사항

QWindowCapture 사용에는 다음과 같은 제한 사항이 적용됩니다:

  • QWindowCapture는 FFmpeg 백엔드에서만 지원됩니다.

QMediaCaptureSessionQCapturableWindow참조하십시오 .

멤버 유형 문서

enum QWindowCapture::Error

QWindowCapture 클래스에서 시그널링할 수 있는 오류 코드를 열거합니다. errorString()는 오류 원인에 대한 자세한 정보를 제공합니다.

상수설명
QWindowCapture::NoError0오류 없음
QWindowCapture::InternalError1내부 창 캡처 드라이버 오류
QWindowCapture::CapturingNotSupported2창 캡처가 지원되지 않습니다.
QWindowCapture::CaptureFailed4창 캡처 실패
QWindowCapture::NotFound5선택한 창을 찾을 수 없습니다.

속성 문서

active : bool

이 속성은 캡처가 현재 활성화되어 있는지 여부를 저장합니다.

액세스 함수:

bool isActive() const
void setActive(bool active)

알림 신호:

void activeChanged(bool)

start() 및 stop()도 참조하세요 .

[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)

QWindowCapture::capturableWindows참조하세요 .

멤버 함수 문서

[explicit] QWindowCapture::QWindowCapture(QObject *parent = nullptr)

parent 를 사용하여 새 QWindowCapture 객체를 생성합니다.

[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)

error 발생 시 신호와 함께 errorString.

[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.