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  ·  Modules  ·  Fonctions  · 

Q3ListBoxItem Class Reference
[Qt3Support module]

The Q3ListBoxItem class is the base class of all list box items. More...

 #include <Q3ListBoxItem>

This class is part of the Qt 3 support library. It is provided to keep old source code working. We strongly advise against using it in new code. See Porting to Qt 4 for more information.

Inherited by Q3ListBoxPixmap and Q3ListBoxText.

Public Functions

Protected Functions


Detailed Description

The Q3ListBoxItem class is the base class of all list box items.

This class is an abstract base class used for all list box items. If you need to insert customized items into a Q3ListBox you must inherit this class and reimplement paint(), height() and width().

See also Q3ListBox.


Member Function Documentation

Q3ListBoxItem::Q3ListBoxItem ( Q3ListBox * listbox = 0 )

Constructs an empty list box item in the list box listbox.

Q3ListBoxItem::Q3ListBoxItem ( Q3ListBox * listbox, Q3ListBoxItem * 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.

Q3ListBoxItem::~Q3ListBoxItem ()   [virtual]

Destroys the list box item.

bool Q3ListBoxItem::current () const

Use isCurrent() instead.

int Q3ListBoxItem::height ( const Q3ListBox * 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().

bool Q3ListBoxItem::isCurrent () const

Returns true if the item is the current item; otherwise returns false.

See also Q3ListBox::currentItem(), Q3ListBox::item(), and isSelected().

bool Q3ListBoxItem::isSelectable () const

Returns true if this item is selectable (the default); otherwise returns false.

See also setSelectable().

bool Q3ListBoxItem::isSelected () const

Returns true if the item is selected; otherwise returns false.

See also Q3ListBox::isSelected() and isCurrent().

Q3ListBox * Q3ListBoxItem::listBox () const

Returns a pointer to the list box containing this item.

Q3ListBoxItem * Q3ListBoxItem::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 Q3ListBoxItem::paint ( QPainter * p )   [pure virtual protected]

Implement this function to draw your item. The painter, p, is already open for painting.

See also height() and width().

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

Returns the pixmap associated with the item, or 0 if there isn't one.

The default implementation returns 0.

Q3ListBoxItem * Q3ListBoxItem::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 Q3ListBoxItem::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.

bool Q3ListBoxItem::selected () const

Use isSelected() instead.

void Q3ListBoxItem::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 isSelected() and paint().

void Q3ListBoxItem::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 Q3ListBoxItem::setText ( const QString & text )   [virtual protected]

Sets the text of the Q3ListBoxItem to text. This text is also used for sorting. The text is not shown unless explicitly drawn in paint().

See also text().

QString Q3ListBoxItem::text () const   [virtual]

Returns the text of the item. This text is also used for sorting.

See also setText().

int Q3ListBoxItem::width ( const Q3ListBox * 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().

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

Comment fermer une application

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