이 페이지에서

QFocusEvent Class

QFocusEvent 클래스에는 위젯 포커스 이벤트에 대한 이벤트 매개변수가 포함되어 있습니다. 더 보기...

헤더: #include <QFocusEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
상속: QEvent

공개 함수

QFocusEvent(QEvent::Type type, Qt::FocusReason reason = Qt::OtherFocusReason)
bool gotFocus() const
bool lostFocus() const
Qt::FocusReason reason() const

보호된 함수

QFocusEvent(QFocusEvent &&)
QFocusEvent &operator=(QFocusEvent &&)
QFocusEvent &operator=(const QFocusEvent &other)

상세 설명

포커스 이벤트는 키보드 입력 포커스가 변경될 때 위젯으로 전송됩니다. 포커스 이벤트는 마우스 동작, 키 입력(예: Tab 또는 Backtab), 창 시스템, 팝업 메뉴, 키보드 단축키 또는 기타 응용 프로그램별 이유로 발생합니다. 특정 포커스 이벤트의 원인은 해당 이벤트 핸들러의 reason()에 의해 반환됩니다.

QWidget::focusInEvent(), QWidget::focusOutEvent(), QGraphicsItem::focusInEvent 및 QGraphicsItem::focusOutEvent() 이벤트 핸들러는 포커스 이벤트를 수신합니다.

QWidget::setFocus(), QWidget::setFocusPolicy() 및 위젯의 키보드 포커스항목도 참조하십시오 .

멤버 함수 문서

[explicit] QFocusEvent::QFocusEvent(QEvent::Type type, Qt::FocusReason reason = Qt::OtherFocusReason)

포커스 이벤트 객체를 생성합니다.

type 매개변수는 QEvent::FocusIn 또는 QEvent::FocusOut 중 하나여야 합니다. reason 는 포커스 변경의 원인을 설명합니다.

[protected delete] QFocusEvent::QFocusEvent(QFocusEvent &&)

QFocusEvent 의 인스턴스를 move-construct로 생성합니다. 이 함수는 삭제되었습니다.

bool QFocusEvent::gotFocus() const

type()의 결과가 QEvent::FocusIn 인 경우 true 를 반환하고, 그렇지 않은 경우 false를 반환합니다.

bool QFocusEvent::lostFocus() const

type()의 결과가 QEvent::FocusOut 인 경우 true 를 반환하고, 그렇지 않은 경우 false를 반환합니다.

Qt::FocusReason QFocusEvent::reason() const

이 포커스 이벤트의 원인을 반환합니다.

[protected delete] QFocusEvent &QFocusEvent::operator=(QFocusEvent &&)

other 를 이 QFocusEvent 인스턴스에 할당합니다. 이 함수는 삭제됩니다.

[noexcept protected default] QFocusEvent &QFocusEvent::operator=(const QFocusEvent &other)

other 를 이 QFocusEvent 인스턴스에 복사-할당합니다.

© 2026 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.