QCheckListItem(3qt)
β¨ QCheckListItem β¨ (from the Qt 3qt manuals, bestie!)
okay so bestie, welcome to QCheckListItem β she's a checkable list view item and she's iconic π
πΈ NAME πΈ
QCheckListItem β Checkable list view items π
π¦ SYNOPSIS π¦
#include <qlistview.h>
Inherits QListViewItem.
π Public Members
enum Type { RadioButton, CheckBox, Controller, RadioButtonController =
Controller, CheckBoxController }
enum ToggleState { Off, NoChange, On }
QCheckListItem ( QCheckListItem * parent, const QString & text, Type tt
= RadioButtonController )
QCheckListItem ( QCheckListItem * parent, QListViewItem * after, const
QString & text, Type tt = RadioButtonController )
QCheckListItem ( QListViewItem * parent, const QString & text, Type tt =
RadioButtonController )
QCheckListItem ( QListViewItem * parent, QListViewItem * after, const
QString & text, Type tt = RadioButtonController )
QCheckListItem ( QListView * parent, const QString & text, Type tt =
RadioButtonController )
QCheckListItem ( QListView * parent, QListViewItem * after, const
QString & text, Type tt = RadioButtonController )
QCheckListItem ( QListViewItem * parent, const QString & text, const
QPixmap & p )
QCheckListItem ( QListView * parent, const QString & text, const QPixmap
& p )
~QCheckListItem ()
virtual void paintCell ( QPainter * p, const QColorGroup & cg, int
column, int width, int align )
virtual void paintFocus ( QPainter * p, const QColorGroup & cg, const
QRect & r )
virtual void setOn ( bool b )
bool isOn () const
Type type () const
QString text () const
void setTristate ( bool b )
bool isTristate () const
ToggleState state () const
void setState ( ToggleState s )
virtual int rtti () const
π Protected Members
virtual void activate ()
void turnOffChild ()
virtual void stateChange ( bool )
π DESCRIPTION π
So the QCheckListItem class gives you checkable list view items. Periodt. π
QCheckListItems live inside QListViews and they're the QListViewItems that show up as checkboxes, radio buttons, or controllers. Choose your fighter β¨
Lowkey important: checkbox and controller check list items can be inserted at any level in a list view. But radio button check list items must be children of a controller check list item β no exceptions, that's the rule, fr fr.
You can check or uncheck the item with setOn(). Wanna know its type? That's type(). Wanna know its text? That's text(). Easy peasy π
<center> [Image Omitted] </center>
See also QListViewItem, QListView, and Advanced Widgets.
π Member Type Documentation π
QCheckListItem::ToggleState
This enum specifies a QCheckListItem's toggle state.
QCheckListItem::OffQCheckListItem::NoChangeQCheckListItem::On
QCheckListItem::Type
This enum type specifies a QCheckListItem's type:
QCheckListItem::RadioButtonQCheckListItem::CheckBoxQCheckListItem::Controllerβ obsolete (useRadioButtonControllerinstead)QCheckListItem::RadioButtonControllerQCheckListItem::CheckBoxController
π MEMBER FUNCTION DOCUMENTATION π
QCheckListItem::QCheckListItem ( QCheckListItem * parent, const QString & text, Type tt = RadioButtonController )
Constructs a checkable item with parent parent, text text and of type tt. Heads up bestie: a RadioButton must be the child of a RadioButtonController, otherwise it will not toggle. No cap π
QCheckListItem::QCheckListItem ( QCheckListItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )
Constructs a checkable item with parent parent, which is after after in the parent's list of children, and with text text and of type tt. Same vibe check as before: a RadioButton must be the child of a RadioButtonController, otherwise it will not toggle.
QCheckListItem::QCheckListItem ( QListViewItem * parent, const QString & text, Type tt = RadioButtonController )
Constructs a checkable item with parent parent, text text and of type tt. And listen β this item must not be a RadioButton. Radio buttons have to be children of a RadioButtonController. That's just the law π«Ά
QCheckListItem::QCheckListItem ( QListViewItem * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )
Constructs a checkable item with parent parent, which is after after in the parent's list of children, with text text and of type tt. Again: this item must not be a RadioButton. Radio buttons must be children of a RadioButtonController.
QCheckListItem::QCheckListItem ( QListView * parent, const QString & text, Type tt = RadioButtonController )
Constructs a checkable item with parent parent, text text and of type tt. Note that tt must not be RadioButton. Radio buttons must be children of a RadioButtonController.
QCheckListItem::QCheckListItem ( QListView * parent, QListViewItem * after, const QString & text, Type tt = RadioButtonController )
Constructs a checkable item with parent parent, which is after after in the parent's list of children, with text text and of type tt. Note that tt must not be RadioButton. Radio buttons must be children of a RadioButtonController.
QCheckListItem::QCheckListItem ( QListViewItem * parent, const QString & text, const QPixmap & p )
Constructs a RadioButtonController item with parent parent, text text and pixmap p. β¨
QCheckListItem::QCheckListItem ( QListView * parent, const QString & text, const QPixmap & p )
Constructs a RadioButtonController item with parent parent, text text and pixmap p. β¨
QCheckListItem::~QCheckListItem ()
Destroys the item, and all its children to any depth, freeing up all allocated resources. She takes everyone with her, respectfully π
void QCheckListItem::activate () [virtual protected]
Toggle check box or set radio button to on.
Reimplemented from QListViewItem.
bool QCheckListItem::isOn () const
Returns TRUE if the item is toggled on; otherwise returns FALSE.
bool QCheckListItem::isTristate () const
Returns TRUE if the item is tristate; otherwise returns FALSE.
See also setTristate().
void QCheckListItem::paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ) [virtual]
Paints the item using the painter p and the color group cg. The item is in column column, has width width and has alignment align. (See Qt::AlignmentFlags for valid alignments.)
Reimplemented from QListViewItem.
void QCheckListItem::paintFocus ( QPainter * p, const QColorGroup & cg, const QRect & r ) [virtual]
Draws the focus rectangle r using the color group cg on the painter p.
Reimplemented from QListViewItem.
int QCheckListItem::rtti () const [virtual]
Returns 1.
Make your derived classes return their own values for rtti(), and you can distinguish between list view items. You should use values greater than 1000, to allow for extensions to this class.
Reimplemented from QListViewItem.
void QCheckListItem::setOn ( bool b ) [virtual]
Sets the button on if b is TRUE, otherwise sets it off. Maintains radio button exclusivity π
void QCheckListItem::setState ( ToggleState s )
Sets the toggle state of the checklistitem to s. s can be Off, NoChange or On.
Tristate can only be enabled for CheckBox or CheckBoxController, therefore the NoChange only applies to them.
Setting the state to On or Off on a CheckBoxController will recursivly set the states of its children to the same state.
Setting the state to NoChange on a CheckBoxController will make it recursivly recall the previous stored state of its children. If there was no previous stored state the children are all set to On.
void QCheckListItem::setTristate ( bool b )
Sets tristate to b if the Type is either a CheckBoxController or a CheckBox.
CheckBoxControllers are tristate by default.
See also state() and isTristate().
ToggleState QCheckListItem::state () const
Returns the state of the item.
See also QCheckListItem::ToggleState.
void QCheckListItem::stateChange ( bool ) [virtual protected]
This virtual function is called when the item changes its state. NoChange (if tristate is enabled and the type is either CheckBox or CheckBoxController) reports the same as Off, so use state() to determine if the state is actually Off or NoChange. π
QString QCheckListItem::text () const
Returns the item's text.
void QCheckListItem::turnOffChild () [protected]
If this is a RadioButtonController that has RadioButton children, turn off the child that is on.
Type QCheckListItem::type () const
Returns the type of this item.
π§ 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.
π 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.
If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qchecklistitem.3qt) and the Qt version (3.3.8).
and that's the whole page, bestie!! ππ she came from Trolltech AS, dated 2 February 2007, and her header/footer vibe is QCheckListItem(3qt) all day every day. slay, study, and may your radio buttons always find their controller π¦β¨π
π¦ 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