Eneboo - Documentación para desarrolladores
Tipos públicos | Métodos públicos | Atributos públicos estáticos | Métodos protegidos
Referencia de la Clase QCheckListItem

The QCheckListItem class provides checkable list view items. Más...

#include <qlistview.h>

Diagrama de herencias de QCheckListItem
QListViewItem QListViewItem Qt Qt Qt Qt

Lista de todos los miembros.

Tipos públicos

enum  Type {
  RadioButton, CheckBox, Controller, RadioButtonController = Controller,
  CheckBoxController, RadioButton, CheckBox, Controller,
  RadioButtonController = Controller, CheckBoxController
}
enum  ToggleState {
  Off, NoChange, On, Off,
  NoChange, On
}
enum  Type {
  RadioButton, CheckBox, Controller, RadioButtonController = Controller,
  CheckBoxController, RadioButton, CheckBox, Controller,
  RadioButtonController = Controller, CheckBoxController
}
enum  ToggleState {
  Off, NoChange, On, Off,
  NoChange, On
}

Métodos públicos

 QCheckListItem (QCheckListItem *parent, const QString &text, Type=RadioButtonController)
 QCheckListItem (QCheckListItem *parent, QListViewItem *after, const QString &text, Type=RadioButtonController)
 QCheckListItem (QListViewItem *parent, const QString &text, Type=RadioButtonController)
 QCheckListItem (QListViewItem *parent, QListViewItem *after, const QString &text, Type=RadioButtonController)
 QCheckListItem (QListView *parent, const QString &text, Type=RadioButtonController)
 QCheckListItem (QListView *parent, QListViewItem *after, const QString &text, Type=RadioButtonController)
 QCheckListItem (QListViewItem *parent, const QString &text, const QPixmap &)
 QCheckListItem (QListView *parent, const QString &text, const QPixmap &)
 ~QCheckListItem ()
void paintCell (QPainter *, const QColorGroup &cg, int column, int width, int alignment)
virtual void paintFocus (QPainter *, const QColorGroup &cg, const QRect &r)
int width (const QFontMetrics &, const QListView *, int column) const
void setup ()
virtual void setOn (bool)
bool isOn () const
Type type () const
QString text () const
QString text (int n) const
void setTristate (bool)
bool isTristate () const
ToggleState state () const
void setState (ToggleState s)
int rtti () const
 QCheckListItem (QCheckListItem *parent, const QString &text, Type=RadioButtonController)
 QCheckListItem (QCheckListItem *parent, QListViewItem *after, const QString &text, Type=RadioButtonController)
 QCheckListItem (QListViewItem *parent, const QString &text, Type=RadioButtonController)
 QCheckListItem (QListViewItem *parent, QListViewItem *after, const QString &text, Type=RadioButtonController)
 QCheckListItem (QListView *parent, const QString &text, Type=RadioButtonController)
 QCheckListItem (QListView *parent, QListViewItem *after, const QString &text, Type=RadioButtonController)
 QCheckListItem (QListViewItem *parent, const QString &text, const QPixmap &)
 QCheckListItem (QListView *parent, const QString &text, const QPixmap &)
 ~QCheckListItem ()
void paintCell (QPainter *, const QColorGroup &cg, int column, int width, int alignment)
virtual void paintFocus (QPainter *, const QColorGroup &cg, const QRect &r)
int width (const QFontMetrics &, const QListView *, int column) const
void setup ()
virtual void setOn (bool)
bool isOn () const
Type type () const
QString text () const
QString text (int n) const
void setTristate (bool)
bool isTristate () const
ToggleState state () const
void setState (ToggleState s)
int rtti () const

Atributos públicos estáticos

static int RTTI = 1

Métodos protegidos

void activate ()
void turnOffChild ()
virtual void stateChange (bool)
void activate ()
void turnOffChild ()
virtual void stateChange (bool)

Descripción detallada

The QCheckListItem class provides checkable list view items.

QCheckListItems are used in {QListView}s to provide {QListViewItem}s that are checkboxes, radio buttons or controllers.

Checkbox and controller check list items may be inserted at any level in a list view. Radio button check list items must be children of a controller check list item.

The item can be checked or unchecked with setOn(). Its type can be retrieved with type() and its text retrieved with text().

qlistviewitems.png List View Items

Ver también:
QListViewItem QListView

Documentación de las enumeraciones miembro de la clase

This enum specifies a QCheckListItem's toggle state.

Off NoChange On

Valores de enumeraciones:
Off 
NoChange 
On 
Off 
NoChange 
On 
Valores de enumeraciones:
Off 
NoChange 
On 
Off 
NoChange 
On 
Valores de enumeraciones:
RadioButton 
CheckBox 
Controller 
RadioButtonController 
CheckBoxController 
RadioButton 
CheckBox 
Controller 
RadioButtonController 
CheckBoxController 

This enum type specifies a QCheckListItem's type:

RadioButton CheckBox Controller obsolete (use RadioButtonController instead) RadioButtonController CheckBoxController

Valores de enumeraciones:
RadioButton 
CheckBox 
Controller 
RadioButtonController 
CheckBoxController 
RadioButton 
CheckBox 
Controller 
RadioButtonController 
CheckBoxController 

Documentación del constructor y destructor

QCheckListItem::QCheckListItem ( QCheckListItem parent,
const QString text,
Type  tt = RadioButtonController 
)

Constructs a checkable item with parent parent, text text and of type tt. Note that a RadioButton must be the child of a RadioButtonController, otherwise it will not toggle.

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. Note that 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. Note that this item must not be a RadioButton. Radio buttons must be children of a RadioButtonController.

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. Note that 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.

QCheckListItem::QCheckListItem ( QCheckListItem parent,
const QString text,
Type  = RadioButtonController 
)
QCheckListItem::QCheckListItem ( QCheckListItem parent,
QListViewItem after,
const QString text,
Type  = RadioButtonController 
)
QCheckListItem::QCheckListItem ( QListViewItem parent,
const QString text,
Type  = RadioButtonController 
)
QCheckListItem::QCheckListItem ( QListViewItem parent,
QListViewItem after,
const QString text,
Type  = RadioButtonController 
)
QCheckListItem::QCheckListItem ( QListView parent,
const QString text,
Type  = RadioButtonController 
)
QCheckListItem::QCheckListItem ( QListView parent,
QListViewItem after,
const QString text,
Type  = RadioButtonController 
)
QCheckListItem::QCheckListItem ( QListViewItem parent,
const QString text,
const QPixmap  
)
QCheckListItem::QCheckListItem ( QListView parent,
const QString text,
const QPixmap  
)
QCheckListItem::~QCheckListItem ( )

Documentación de las funciones miembro

void QCheckListItem::activate ( ) [protected, virtual]

Toggle check box or set radio button to on.

Reimplementado de QListViewItem.

void QCheckListItem::activate ( ) [protected, virtual]

This virtual function is called whenever the user presses the mouse on this item or presses Space on it.

Ver también:
activatedPos()

Reimplementado de QListViewItem.

bool QCheckListItem::isOn ( ) const [inline]
bool QCheckListItem::isOn ( ) const [inline]

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.

Ver también:
setTristate()
bool QCheckListItem::isTristate ( ) const
void QCheckListItem::paintCell ( QPainter p,
const QColorGroup cg,
int  column,
int  width,
int  align 
) [virtual]

This virtual function paints the contents of one column of an item and aligns it as described by align.

p is a QPainter open on the relevant paint device. p is translated so (0, 0) is the top-left pixel in the cell and width-1, height()-1 is the bottom-right pixel in the cell. The other properties of p (pen, brush, etc) are undefined. cg is the color group to use. column is the logical column number within the item that is to be painted; 0 is the column which may contain a tree.

This function may use QListView::itemMargin() for readability spacing on the left and right sides of data such as text, and should honor isSelected() and QListView::allColumnsShowFocus().

If you reimplement this function, you should also reimplement width().

The rectangle to be painted is in an undefined state when this function is called, so you must draw on all the pixels. The painter p has the right font on entry.

Ver también:
paintBranches(), QListView::drawContentsOffset()

Reimplementado de QListViewItem.

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.)

Reimplementado de QListViewItem.

virtual void QCheckListItem::paintFocus ( QPainter p,
const QColorGroup cg,
const QRect r 
) [virtual]

Paints a focus indicator on the rectangle r using painter p and colors cg.

p is already clipped.

Ver también:
paintCell() paintBranches() QListView::setAllColumnsShowFocus()

Reimplementado de 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.

Reimplementado de QListViewItem.

int QCheckListItem::rtti ( ) const [virtual]

Returns 0.

Make your derived classes return their own values for rtti(), so that you can distinguish between different kinds of list view items. You should use values greater than 1000 to allow for extensions to this class.

Reimplementado de 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.

Reimplementado de QListViewItem.

virtual void QCheckListItem::setOn ( bool  ) [virtual]
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::setState ( ToggleState  s)
void QCheckListItem::setTristate ( bool  b)

Sets tristate to b if the Type is either a CheckBoxController or a CheckBox.

CheckBoxControllers are tristate by default.

Ver también:
state() isTristate()
void QCheckListItem::setTristate ( bool  )
void QCheckListItem::setup ( void  ) [virtual]

Reimplementado de QListViewItem.

void QCheckListItem::setup ( void  ) [virtual]

This virtual function is called before the first time QListView needs to know the height or any other graphical attribute of this object, and whenever the font, GUI style, or colors of the list view change.

The default calls widthChanged() and sets the item's height to the height of a single line of text in the list view's font. (If you use icons, multi-line text, etc., you will probably need to call setHeight() yourself or reimplement it.)

Reimplementado de QListViewItem.

QCheckListItem::ToggleState QCheckListItem::state ( ) const

Returns the state of the item.

Ver también:
QCheckListItem::ToggleState
ToggleState QCheckListItem::state ( ) const
void QCheckListItem::stateChange ( bool  ) [protected, virtual]

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.

virtual void QCheckListItem::stateChange ( bool  ) [protected, virtual]
QString QCheckListItem::text ( int  column) const [inline, virtual]

Returns the text in column column, or QString::null if there is no text in that column.

Ver también:
key() paintCell()

Reimplementado de QListViewItem.

QString QCheckListItem::text ( ) const [inline]

Returns the item's text.

QString QCheckListItem::text ( ) const [inline]
QString QCheckListItem::text ( int  n) const [inline, virtual]

Reimplementado de QListViewItem.

void QCheckListItem::turnOffChild ( ) [protected]
void QCheckListItem::turnOffChild ( ) [protected]

If this is a RadioButtonController that has RadioButton children, turn off the child that is on.

QCheckListItem::Type QCheckListItem::type ( ) const [inline]

Returns the type of this item.

Type QCheckListItem::type ( ) const [inline]
int QCheckListItem::width ( const QFontMetrics fm,
const QListView lv,
int  c 
) const [virtual]

Returns the number of pixels of width required to draw column c of list view lv, using the metrics fm without cropping. The list view containing this item may use this information depending on the QListView::WidthMode settings for the column.

The default implementation returns the width of the bounding rectangle of the text of column c.

Ver también:
listView() widthChanged() QListView::setColumnWidthMode() QListView::itemMargin()

Reimplementado de QListViewItem.

int QCheckListItem::width ( const QFontMetrics fm,
const QListView lv,
int  column 
) const [virtual]

Reimplementado de QListViewItem.


Documentación de los datos miembro

static int QCheckListItem::RTTI = 1 [static]

Reimplementado de QListViewItem.


La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'