QFocusEvent(3qt)
π QFocusEvent β a lil manual page, but make it a vibe π
okay so bestie, you're reading the QFocusEvent(3qt) man page and honestly? slay. it's a Qt 3 thing, it's from Trolltech, and it's all about focus events for widgets. let's get into it fr fr π¦
β¨ NAME β¨
QFocusEvent β event parameters for widget focus events π
so basically: when the keyboard focus moves around, this is the lil object that carries the tea about why. π
πΈ SYNOPSIS πΈ
#include <qevent.h>
Inherits QEvent.
π Public Members
QFocusEvent ( Type type )
bool gotFocus () const
bool lostFocus () const
enum Reason { Mouse, Tab, Backtab, ActiveWindow, Popup, Shortcut, Other
}
β Static Public Members
Reason reason ()
void setReason ( Reason reason )
void resetReason ()
π DESCRIPTION π
The QFocusEvent class contains event parameters for widget focus events. that's the whole gig, no cap.
Focus events get sent to widgets whenever the keyboard input focus changes. like, focus be moving and the widget needs to know about it. π«Ά
and why does focus move?? so many reasons bestie:
- mouse actions π±οΈ
- keypresses (e.g.
TaborBacktab) β¨οΈ - the window system πͺ
- popup menus π
- keyboard shortcuts β‘
- or other application specific reasons π
The reason for a particular focus event is returned by reason() in the appropriate event handler. so when you're chilling inside your handler, that's where you ask "okay but why tho".
The event handlers that receive focus events are QWidget::focusInEvent() and QWidget::focusOutEvent(). those two are the ones holding the door. πͺ
Use setReason() to set the reason for all focus events, and resetReason() to set the reason for all focus events to the reason that was in force before the last setReason() call. it's giving undo button, honestly. π
See also QWidget::setFocus(), QWidget::focusPolicy, and Event Classes.
π§ Member Type Documentation β QFocusEvent::Reason π§
This enum specifies why the focus changed. it's the receipts, basically. π§Ύ
QFocusEvent::Mouseβ because of a mouse action. π±οΈQFocusEvent::Tabβ because of aTabpress. β¨οΈQFocusEvent::Backtabβ because of aBacktabpress (possibly including Shift/Control, e.g.Shift+Tab). πQFocusEvent::ActiveWindowβ because the window system made this window (in)active. πͺQFocusEvent::Popupβ because the application opened/closed a popup that grabbed/released focus. πQFocusEvent::Shortcutβ because of a keyboard shortcut. β‘QFocusEvent::Otherβ any other reason, usually application-specific. π
See the keyboard focus overview for more about focus. iykyk.
π MEMBER FUNCTION DOCUMENTATION π
π« QFocusEvent::QFocusEvent ( Type type )
Constructs a focus event object. baby's first focus event, iconic. β¨
The type parameter must be either QEvent::FocusIn or QEvent::FocusOut. those are the only two options, no substitutes, periodt.
π bool QFocusEvent::gotFocus () const
Returns TRUE if the widget received the text input focus; otherwise returns FALSE. did you get the focus?? yes or no bestie, no in-between. π«Ά
π bool QFocusEvent::lostFocus () const
Returns TRUE if the widget lost the text input focus; otherwise returns FALSE. and if it's TRUE... we mourn. π
β Reason QFocusEvent::reason () [static]
Returns the reason for this focus event. the why. the lore. π
See also setReason().
π¦ void QFocusEvent::resetReason () [static]
Resets the reason for all future focus events to the value before the last setReason() call. take it back to how it was, we love a rewind. π
See also reason() and setReason().
π₯ void QFocusEvent::setReason ( Reason reason ) [static]
Sets the reason for all future focus events to reason. boom, declared. π’
See also reason() and resetReason().
π SEE ALSO π
π COPYRIGHT π
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. read it, bestie, it's the rules. π
π§ AUTHOR π§
Generated automatically from the source code. not a human, just a machine doing its lil thing. π€β¨
π BUGS π
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. π«Ά (we literally mean it, good bug reports are a love language.)
The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. so like... it's a gift, not an official channel. π
If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qfocusevent.3qt) and the Qt version (3.3.8). pleaseeee include both, otherwise the bug report is giving lost puppy. π
okay that's the whole page, you ate it up. π½οΈπ
this was Trolltech AS, dated 2 February 2007, and you just finished reading QFocusEvent(3qt). mwah. π go forth and know your focus reasons, bestie. πΈπ¦β¨
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms