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

The QComboTableItem class provides a means of using comboboxes in QTables.table. Más...

#include <qtable.h>

Diagrama de herencias de QComboTableItem
QTableItem QTableItem Qt Qt Qt Qt ConnectionItem ReceiverItem SenderItem SignalItem SlotItem

Lista de todos los miembros.

Métodos públicos

 QComboTableItem (QTable *table, const QStringList &list, bool editable=FALSE)
 ~QComboTableItem ()
virtual QWidgetcreateEditor () const
virtual void setContentFromEditor (QWidget *w)
virtual void paint (QPainter *p, const QColorGroup &cg, const QRect &cr, bool selected)
virtual void setCurrentItem (int i)
virtual void setCurrentItem (const QString &i)
int currentItem () const
QString currentText () const
int count () const
QString text (int i) const
virtual void setEditable (bool b)
bool isEditable () const
virtual void setStringList (const QStringList &l)
int rtti () const
QSize sizeHint () const
 QComboTableItem (QTable *table, const QStringList &list, bool editable=FALSE)
 ~QComboTableItem ()
virtual QWidgetcreateEditor () const
virtual void setContentFromEditor (QWidget *w)
virtual void paint (QPainter *p, const QColorGroup &cg, const QRect &cr, bool selected)
virtual void setCurrentItem (int i)
virtual void setCurrentItem (const QString &i)
int currentItem () const
QString currentText () const
int count () const
QString text (int i) const
virtual void setEditable (bool b)
bool isEditable () const
virtual void setStringList (const QStringList &l)
int rtti () const
QSize sizeHint () const

Atributos públicos estáticos

static int RTTI = 1

Descripción detallada

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

table.

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 {QTable}s. 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 {QTableItem}s and {QCheckTableItem}s using their Run Time Type Identification number (see rtti()).

qtableitems.png Table Items

Ver también:
QCheckTableItem QTableItem QComboBox

Documentación del constructor y destructor

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.

Ver también:
QTable::clearCell() EditType
QComboTableItem::~QComboTableItem ( )

QComboTableItem destructor.

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

Documentación de las funciones miembro

int QComboTableItem::count ( ) const

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

int QComboTableItem::count ( ) const
QWidget * QComboTableItem::createEditor ( ) const [virtual]

Reimplementado de QTableItem.

Reimplementado en SenderItem, ReceiverItem, SignalItem y SlotItem.

virtual QWidget* QComboTableItem::createEditor ( ) const [virtual]

This virtual function creates an editor which the user can interact with to edit the cell's contents. The default implementation creates a QLineEdit.

If the function returns 0, the cell is read-only.

The returned widget should preferably be invisible, ideally with QTable::viewport() as parent.

If you reimplement this function you'll almost certainly need to reimplement setContentFromEditor(), and may need to reimplement sizeHint().

table/statistics/statistics.cpp createEditor }

Ver también:
QTable::createEditor() setContentFromEditor() QTable::viewport() setReplaceable()

Reimplementado de QTableItem.

Reimplementado en SenderItem, ReceiverItem, SignalItem y SlotItem.

int QComboTableItem::currentItem ( ) const
int QComboTableItem::currentItem ( ) const

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

Ver también:
setCurrentItem()
QString QComboTableItem::currentText ( ) const
QString QComboTableItem::currentText ( ) const

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

Ver también:
currentItem() 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.

Ver también:
setEditable()
bool QComboTableItem::isEditable ( ) const
virtual void QComboTableItem::paint ( QPainter p,
const QColorGroup cg,
const QRect cr,
bool  selected 
) [virtual]

This virtual function is used to paint the contents of an item using the painter p in the rectangular area cr using the color group cg.

If selected is TRUE the cell is displayed in a way that indicates that it is highlighted.

You don't usually need to use this function but if you want to draw custom content in a cell you will need to reimplement it.

The painter passed to this function is translated so that 0, 0 is the top-left corner of the item that is being painted.

Note that the painter is not clipped by default in order to get maximum efficiency. If you want clipping, use

    p->setClipRect( table()->cellRect(row, col), QPainter::ClipPainter );
    //... your drawing code
    p->setClipping( FALSE );

Reimplementado de QTableItem.

Reimplementado en ConnectionItem.

void QComboTableItem::paint ( QPainter p,
const QColorGroup cg,
const QRect cr,
bool  selected 
) [virtual]

Reimplementado de QTableItem.

Reimplementado en ConnectionItem.

int QComboTableItem::rtti ( ) const [virtual]

Returns the Run Time Type Identification value for this table item which for QTableItems is 0.

When you create subclasses based on QTableItem make sure that each subclass returns a unique rtti() value. It is advisable to use values greater than 1000, preferably large random numbers, to allow for extensions to this class.

Ver también:
QCheckTableItem::rtti() QComboTableItem::rtti()

Reimplementado de QTableItem.

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.

Ver también:
QTableItem::rtti()

Reimplementado de QTableItem.

void QComboTableItem::setContentFromEditor ( QWidget w) [virtual]

Reimplementado de QTableItem.

virtual void QComboTableItem::setContentFromEditor ( QWidget w) [virtual]

Whenever the content of a cell has been edited by the editor w, QTable calls this virtual function to copy the new values into the QTableItem.

If you reimplement createEditor() and return something that is not a QLineEdit you will need to reimplement this function.

table/statistics/statistics.cpp setContentFromEditor }

Ver también:
QTable::setCellContentFromEditor()

Reimplementado de QTableItem.

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

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

Ver también:
currentItem()
virtual void QComboTableItem::setCurrentItem ( int  i) [virtual]
virtual void QComboTableItem::setCurrentItem ( const QString i) [virtual]
void QComboTableItem::setCurrentItem ( const QString s) [virtual]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. 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.

Ver también:
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.

Ver también:
isEditable()
virtual void QComboTableItem::setEditable ( bool  b) [virtual]
virtual void QComboTableItem::setStringList ( const QStringList l) [virtual]
void QComboTableItem::setStringList ( const QStringList l) [virtual]

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

QSize QComboTableItem::sizeHint ( ) const [virtual]

Reimplementado de QTableItem.

QSize QComboTableItem::sizeHint ( ) const [virtual]

This virtual function returns the size a cell needs to show its entire content.

If you subclass QTableItem you will often need to reimplement this function.

Reimplementado de QTableItem.

QString QComboTableItem::text ( int  i) const
QString QComboTableItem::text ( int  i) const

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

Ver también:
currentText()

Documentación de los datos miembro

static int QComboTableItem::RTTI = 1 [static]

Reimplementado de QTableItem.


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'