Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Fonctions  · 

QCheckListItem Class Reference

The QCheckListItem class provides checkable list view items. More...

#include <qlistview.h>

Inherits QListViewItem.

List of all member functions.

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


Detailed Description

The QCheckListItem class provides checkable list view items.

QCheckListItems are used in QListViews to provide QListViewItems 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().

List View Items

See also QListViewItem, QListView, and Advanced Widgets.


Member Type Documentation

QCheckListItem::ToggleState

This enum specifies a QCheckListItem's toggle state.

  • QCheckListItem::Off
  • QCheckListItem::NoChange
  • QCheckListItem::On

QCheckListItem::Type

This enum type specifies a QCheckListItem's type:

  • QCheckListItem::RadioButton
  • QCheckListItem::CheckBox
  • QCheckListItem::Controller - obsolete (use RadioButtonController instead)
  • QCheckListItem::RadioButtonController
  • QCheckListItem::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. 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.

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.


This file is part of the Qt toolkit. Copyright © 1995-2003 Trolltech. All Rights Reserved.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 65
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Developer Network au hasard

Logo

Applications mobiles modernes avec Qt et QML

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 3.2
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web