QFocusEvent Class
QFocusEvent 클래스에는 위젯 포커스 이벤트에 대한 이벤트 매개변수가 포함되어 있습니다. 더 보기...
Header: | #include <QFocusEvent> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
qmake: | QT += gui |
상속합니다: | QEvent |
- 상속된 멤버를 포함한 모든 멤버 목록
- QFocusEvent는 이벤트 클래스의 일부입니다.
공용 함수
QFocusEvent(QEvent::Type type, Qt::FocusReason reason = Qt::OtherFocusReason) | |
bool | gotFocus() const |
bool | lostFocus() const |
Qt::FocusReason | reason() const |
상세 설명
포커스 이벤트는 키보드 입력 포커스가 변경될 때 위젯으로 전송됩니다. 포커스 이벤트는 마우스 동작, 키 누르기(예: 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 은 포커스 변경의 원인을 설명합니다.
bool QFocusEvent::gotFocus() const
type()가 QEvent::FocusIn 인 경우 true
을 반환하고, 그렇지 않으면 false를 반환합니다.
bool QFocusEvent::lostFocus() const
type()가 QEvent::FocusOut 인 경우 true
을 반환하고, 그렇지 않으면 false를 반환합니다.
Qt::FocusReason QFocusEvent::reason() const
이 포커스 이벤트의 이유를 반환합니다.
© 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.