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  · 

QComboTableItem Class Reference
[table module]

The QComboTableItem class provides a means of using comboboxes in QTables. More...

#include <qtable.h>

Inherits QTableItem.

List of all member functions.

Public Members


Detailed Description

The QComboTableItem class provides a means of using comboboxes in QTables.

A QComboTableItem is a table item which looks and behaves like a combobox. The advantage of using QComboTableItems rather than real comboboxes is that a QComboTableItem uses far less resources than real comboboxes in QTables. When the cell has the focus it displays a real combobox which the user can interact with. When the cell does not have the focus the cell looks like a combobox. Only text items (i.e. no pixmaps) may be used in QComboTableItems.

QComboTableItem items have the edit type WhenCurrent (see EditType). The QComboTableItem's list of items is provided by a QStringList passed to the constructor.

The list of items may be changed using setStringList(). The current item can be set with setCurrentItem() and retrieved with currentItem(). The text of the current item can be obtained with currentText(), and the text of a particular item can be retrieved with text().

If isEditable() is TRUE the QComboTableItem will permit the user to either choose an existing list item, or create a new list item by entering their own text; otherwise the user may only choose one of the existing list items.

To populate a table cell with a QComboTableItem use QTable::setItem().

QComboTableItems may be deleted with QTable::clearCell().

QComboTableItems can be distinguished from QTableItems and QCheckTableItems using their Run Time Type Identification number (see rtti()).

Table Items

See also QCheckTableItem, QTableItem, QComboBox, and Advanced Widgets.


Member Function Documentation

QComboTableItem::QComboTableItem ( QTable * table, const QStringList & list, bool editable = FALSE )

Creates a combo table item for the table table. The combobox's list of items is passed in the list argument. If editable is TRUE the user may type in new list items; if editable is FALSE the user may only select from the list of items provided.

By default QComboTableItems cannot be replaced by other table items since isReplaceable() returns FALSE by default.

See also QTable::clearCell() and EditType.

QComboTableItem::~QComboTableItem ()

QComboTableItem destructor.

int QComboTableItem::count () const

Returns the total number of list items in the combo table item.

int QComboTableItem::currentItem () const

Returns the index of the combo table item's current list item.

See also setCurrentItem().

QString QComboTableItem::currentText () const

Returns the text of the combo table item's current list item.

See also currentItem() and text().

bool QComboTableItem::isEditable () const

Returns TRUE if the user can add their own list items to the combobox's list of items; otherwise returns FALSE.

See also setEditable().

int QComboTableItem::rtti () const [virtual]

Returns 1.

Make your derived classes return their own values for rtti()to distinguish between different table item subclasses. You should use values greater than 1000, preferably a large random number, to allow for extensions to this class.

See also QTableItem::rtti().

Reimplemented from QTableItem.

void QComboTableItem::setCurrentItem ( int i ) [virtual]

Sets the list item i to be the combo table item's current list item.

See also currentItem().

Example: table/small-table-demo/main.cpp.

void QComboTableItem::setCurrentItem ( const QString & s ) [virtual]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Sets the list item whose text is s to be the combo table item's current list item. Does nothing if no list item has the text s.

See also currentItem().

void QComboTableItem::setEditable ( bool b ) [virtual]

If b is TRUE the combo table item can be edited, i.e. the user may enter a new text item themselves. If b is FALSE the user may may only choose one of the existing items.

See also isEditable().

void QComboTableItem::setStringList ( const QStringList & l ) [virtual]

Sets the list items of this QComboTableItem to the strings in the string list l.

QString QComboTableItem::text ( int i ) const

Returns the text of the combo's list item at index i.

See also currentText().


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 53
  2. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  3. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  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 Quarterly au hasard

Logo

Implémenter un mutex en lecture et en écriture

Qt Quarterly est la revue trimestrielle proposée par Nokia et à destination des développeurs Qt. Ces articles d'une grande qualité technique sont rédigés par des experts Qt. 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.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