QFocusData(3qt)
π QFocusData π
okay so bestie, welcome to the QFocusData(3qt) manual page π this one's all about the class that keeps track of who's next in the focus chain. slay. let's get into it β¨
πΈ NAME πΈ
QFocusData β maintains the list of widgets in the focus chain π¦
β¨ SYNOPSIS β¨
#include <qfocusdata.h>
π Public Members
QWidget * focusWidget () const
QWidget * home ()
QWidget * next ()
QWidget * prev ()
QWidget * first () const
QWidget * last () const
int count () const
π DESCRIPTION π
The QFocusData class maintains the list of widgets in the focus chain. literally its whole job, and it does it beautifully π
This read-only list always contains at least one widget (i.e. the top-level widget). no cap. it gives you a simple cursor that you can reset to the current focus widget using home(), or move to its neighboring widgets using next() and prev(). you can also retrieve the count() of the number of widgets in the list. and here's the iconic part β the list is a loop, so if you keep iterating, for example using next(), you will never come to the end. it's giving infinite hallway π
Some widgets in the list may not accept focus. Widgets are added to the list as necessary, but not removed from it. this lets widgets change focus policy dynamically without disrupting the focus chain the user experiences. when a widget disables and re-enables tab focus, its position in the focus chain does not change. periodt. π
When reimplementing QWidget::focusNextPrevChild() to provide special focus flow, you will usually call QWidget::focusData() to retrieve the focus data stored at the top-level widget. a top-level widget's focus data contains the focus list for its hierarchy of widgets. main character energy tbh π
β οΈ The cursor may change at any time. π
π« This class is not thread-safe. do not come for it with threads bestie, it will not survive π
See also QWidget::focusNextPrevChild(), QWidget::setTabOrder(), QWidget::focusPolicy, and Miscellaneous Classes. π«Ά
π MEMBER FUNCTION DOCUMENTATION π
β int QFocusData::count () const
Returns the number of widgets in the focus chain. just a lil headcount, no cursor drama πΈ
β QWidget * QFocusData::first () const
Returns the first widget in the focus chain. The cursor is not modified. your cursor stays exactly where it was, bestie π¦
β QWidget * QFocusData::focusWidget () const
Returns the widgets in the hierarchy that are in the focus chain. π
β QWidget * QFocusData::home ()
Moves the cursor to the focusWidget() and returns that widget. You must call this before next() or prev() to iterate meaningfully. like, genuinely, do not skip this step or your iteration is gonna be nonsense π
β QWidget * QFocusData::last () const
Returns the last widget in the focus chain. The cursor is not modified. π
β QWidget * QFocusData::next ()
Moves the cursor to the next widget in the focus chain. There is always a next widget because the list is a loop. always. forever. slay π₯
β QWidget * QFocusData::prev ()
Moves the cursor to the previous widget in the focus chain. There is always a previous widget because the list is a loop. same deal, other direction π«
π 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.
πΈ AUTHOR πΈ
Generated automatically from the source code. (the code wrote its own autobiography, iconic honestly)
π 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. π«Ά
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. ngl, respect the man page girlies π
If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qfocusdata.3qt) and the Qt version (3.3.8).
and that's the whole page bestie!! brought to you by Trolltech AS on 2 February 2007, Qt version 3.3.8 β¨ bye babes, go iterate that focus chain πππ¦πβ¨
π¦ 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