QListBoxItem(3qt)
π QListBoxItem β the qlistboxitem man page, but make it make sense π
okay bestie, sit down, hydrate, because we're talking about QListBoxItem from the Qt 3 docs (that's the 3qt manual, and yes she's an icon of her era). This is the base class of all list box items β the blueprint, the template, the main character that every other list box item is lowkey cosplaying as. π
β¨ NAME β¨
QListBoxItem β the base class of all list box items. she's abstract, she's foundational, she's literally the mother of QListBoxText and QListBoxPixmap. π
πΈ SYNOPSIS πΈ
#include <qlistbox.h>
Inherited by QListBoxText and QListBoxPixmap. π¦
π Public Members
QListBoxItem ( QListBox * listbox = 0 )
QListBoxItem ( QListBox * listbox, QListBoxItem * after )
virtual ~QListBoxItem ()
virtual QString text () const
virtual const QPixmap * pixmap () const
virtual int height ( const QListBox * lb ) const
virtual int width ( const QListBox * lb ) const
bool isSelected () const
bool isCurrent () const
bool selected () const (obsolete)
bool current () const (obsolete)
QListBox * listBox () const
void setSelectable ( bool b )
bool isSelectable () const
QListBoxItem * next () const
QListBoxItem * prev () const
virtual int rtti () const
π§ Protected Members
virtual void paint ( QPainter * p ) = 0
virtual void setText ( const QString & text )
void setCustomHighlighting ( bool b )
π DESCRIPTION π
okay so, QListBoxItem is the base class of all list box items. periodt.
She's an abstract base class β meaning you do not simply instantiate her and vibe, no ma'am β used for all list box items. If you need to insert customized items into a QListBox, you must inherit this class and reimplement paint(), height() and width(). All three. No skipping, bestie, I will know. π
See also QListBox. π«Ά
π MEMBER FUNCTION DOCUMENTATION π
QListBoxItem::QListBoxItem ( QListBox * listbox = 0 )
Constructs an empty list box item in the list box listbox. empty! blank slate! new era! β¨
QListBoxItem::QListBoxItem ( QListBox * listbox, QListBoxItem * after )
Constructs an empty list box item in the list box listbox and inserts it after the item after β or at the beginning if after is 0. so if you pass 0 she's cutting the line and going first. iconic behaviour honestly. π
QListBoxItem::~QListBoxItem () [virtual]
Destroys the list box item. goodbye queen, you served. π₯
bool QListBoxItem::current () const
β οΈ This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code.
int QListBoxItem::height ( const QListBox * lb ) const [virtual]
Implement this function to return the height of your item. The lb parameter is the same as listBox() and is provided for convenience and compatibility.
The default implementation returns QApplication::globalStrut()'s height.
See also paint() and width().
Reimplemented in QListBoxText and QListBoxPixmap. π
bool QListBoxItem::isCurrent () const
Returns TRUE if the item is the current item; otherwise returns FALSE.
See also QListBox::currentItem, QListBox::item(), and isSelected().
bool QListBoxItem::isSelectable () const
Returns TRUE if this item is selectable (the default); otherwise returns FALSE.
See also setSelectable().
bool QListBoxItem::isSelected () const
Returns TRUE if the item is selected; otherwise returns FALSE.
See also QListBox::isSelected() and isCurrent().
Example: listboxcombo/listboxcombo.cpp. π₯
QListBox * QListBoxItem::listBox () const
Returns a pointer to the list box containing this item. she knows her home. π
QListBoxItem * QListBoxItem::next () const
Returns the item that comes after this in the list box. If this is the last item, 0 is returned.
See also prev().
void QListBoxItem::paint ( QPainter * p ) [pure virtual protected]
Implement this function to draw your item. The painter, p, is already open for painting. so like, don't go opening her again, she's ready. π¨
See also height() and width().
Example: listboxcombo/listboxcombo.cpp.
Reimplemented in QListBoxText and QListBoxPixmap.
const QPixmap * QListBoxItem::pixmap () const [virtual]
Returns the pixmap associated with the item, or 0 if there isn't one.
The default implementation returns 0.
Example: listboxcombo/listboxcombo.cpp.
Reimplemented in QListBoxPixmap. πΌοΈ
QListBoxItem * QListBoxItem::prev () const
Returns the item which comes before this in the list box. If this is the first item, 0 is returned.
See also next().
int QListBoxItem::rtti () const [virtual]
Returns 0.
Make your derived classes return their own values for rtti(), and you can distinguish between listbox items. You should use values greater than 1000, preferably a large random number, to allow for extensions to this class. (yes, a big random number. it's giving "pick a number between 1000 and vibes" and that's the actual documented advice, no cap. π)
bool QListBoxItem::selected () const
β οΈ This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code.
void QListBoxItem::setCustomHighlighting ( bool b ) [protected]
Defines whether the list box item is responsible for drawing itself in a highlighted state when being selected.
If b is FALSE (the default), the list box will draw some default highlight indicator before calling paint().
See also selected() and paint().
void QListBoxItem::setSelectable ( bool b )
If b is TRUE (the default) then this item can be selected by the user; otherwise this item cannot be selected by the user.
See also isSelectable().
void QListBoxItem::setText ( const QString & text ) [virtual protected]
Sets the text of the QListBoxItem to text. This text is also used for sorting. The text is not shown unless explicitly drawn in paint(). so like, she holds the words but she does not show the words. the words are for sorting. the words are for the algorithm. π
See also text().
QString QListBoxItem::text () const [virtual]
Returns the text of the item. This text is also used for sorting.
See also setText().
Example: listboxcombo/listboxcombo.cpp. β¨
int QListBoxItem::width ( const QListBox * lb ) const [virtual]
Reimplement this function to return the width of your item. The lb parameter is the same as listBox() and is provided for convenience and compatibility.
The default implementation returns QApplication::globalStrut()'s width.
See also paint() and height().
Reimplemented in QListBoxText and QListBoxPixmap. πΈ
π¦ 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. (no human author, just a robot doing her best and honestly? slay. π)
π 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. (fr fr, a good bug report is a love letter. π)
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.
If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qlistboxitem.3qt) and the Qt version (3.3.8).
and that's the whole page, bestie β brought to you by Trolltech AS, dated 2 February 2007, living under the header QListBoxItem(3qt) and stamped at the bottom with QListBoxItem(3qt) again because she said it twice and she's allowed. go forth and reimplement paint(), height() and width(). mwah. πβ¨π«Ά
π¦ 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