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  ·  Classes  ·  Annotées  ·  Hiérarchie  ·  Fonctions  ·  Structure  · 

QListBoxItem Class Reference


This is the base class of all list box items. More...

#include <qlistbox.h>

Inherited by QListBoxPixmap and QListBoxText.

List of all member functions.

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 * ) const
  • virtual int width ( const QListBox * ) const
  • bool selected () const
  • bool current () const
  • QListBox* listBox () const
  • void setSelectable ( bool b ) 
  • bool isSelectable () const
  • QListBoxItem* next () const
  • QListBoxItem* prev () const

Protected Members

  • virtual void paint ( QPainter * ) 
  • virtual void setText ( const QString & text ) 
  • void setCustomHighlighting ( bool ) 

Detailed Description

This is the base class of all list box items.

This class is the abstract base class of 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().

See also QListBox.


Member Function Documentation

QListBoxItem::QListBoxItem ( QListBox * listbox = 0 )

Constructs an empty list box item in the listbox listbox

QListBoxItem::QListBoxItem ( QListBox * listbox, QListBoxItem * after )

Constructs an empty list box item in the listbox listbox and inserts it after the item after.

QListBoxItem::~QListBoxItem () [virtual]

Destroys the list box item.

bool QListBoxItem::current () const

Returns TRUE if the item is the current item, else FALSE.

See also QListBox::currentItem(), QListBox::item() and selected().

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.

See also paint() and width().

Reimplemented in QListBoxPixmap and QListBoxText.

bool QListBoxItem::isSelectable () const

Returns if this item is selectable or not.

See also setSelectable().

QListBox * QListBoxItem::listBox () const

Returns a pointer to the listbox containing this item.

QListBoxItem * QListBoxItem::next () const

Returns the item which comes after this in the listbox. If this is the last item, 0 is returned.

void QListBoxItem::paint ( QPainter * p ) [virtual protected]

Implement this function to draw your item.

See also height() and width().

Reimplemented in QListBoxText and QListBoxPixmap.

const QPixmap * QListBoxItem::pixmap () const [virtual]

Returns the pixmap connected with the item, if any.

The default implementation of this function returns a null pointer.

Reimplemented in QListBoxPixmap.

QListBoxItem * QListBoxItem::prev () const

Returns the item which comes before this in the listbox. If this is the first item, 0 is returned.

bool QListBoxItem::selected () const

Returns TRUE if the item is selected, else FALSE.

See also QListBox::isSelected() and current().

void QListBoxItem::setCustomHighlighting ( bool b ) [protected]

Defines whether the list box items is responsible to draw itself in a highlighted state when being selected.

If b is FALSE (the default), then the listbox will draw some default highlight indicator before calling paint().

See also selected() and paint().

void QListBoxItem::setSelectable ( bool b )

Specifies if this item may be selected by the user or not.

See also isSelectable().

void QListBoxItem::setText ( const QString & text ) [virtual protected]

Sets the text of the widget, which is used for sorting too. The text is not shown unless explicitly drawn in paint().

See also text().

QString QListBoxItem::text () const [virtual]

Returns the text of the item, which is used for sorting too.

See also setText().

int QListBoxItem::width ( const QListBox * lb ) const [virtual]

Implement this function to return the width of your item. The lb parameter is the same as listBox() and is provided for convenience and compatibility.

See also paint() and height().

Reimplemented in QListBoxText and QListBoxPixmap.


Search the documentation, FAQ, qt-interest archive and more (uses www.trolltech.com):


This file is part of the Qt toolkit, copyright © 1995-2005 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 64
  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

Extension de Qt WebKit

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 2.3
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