QFocusEvent(3qt)

πŸ“¦ version 3.3.8b, in fedora 43, fedora 44

πŸ’– 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. Tab or Backtab) ⌨️
  • 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 a Tab press. ⌨️
  • QFocusEvent::Backtab β€” because of a Backtab press (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 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