Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QString Q3TableItem::text (  )  const [virtual]

Returns the text of the table item or an empty string if there is no text.

To ensure that the current value of the editor is returned, setContentFromEditor() is called: 1 if the editMode() is Always, or if editMode() is not Always but the editor of the cell is active and the editor is not a QLineEdit.

This means that text() returns the original text value of the item if the editor is a line edit, until the user commits an edit (e.g. by pressing Enter or Tab) in which case the new text is returned. For other editors (e.g. a combobox) setContentFromEditor() is always called so the currently display value is the one returned.

See also:
setText() pixmap()

Definition at line 665 of file q3table.cpp.

References Q3Table::cellWidget(), rtti(), and table().

Referenced by alignment(), Q3CheckTableItem::createEditor(), createEditor(), Q3Table::endEdit(), key(), Q3CheckTableItem::paint(), paint(), sizeHint(), and Q3Table::text().

{
    QWidget *w = table()->cellWidget(rw, cl);
    if (w && (edType == Always ||
                rtti() == Q3ComboTableItem::RTTI ||
                rtti() == Q3CheckTableItem::RTTI))
        ((Q3TableItem*)this)->setContentFromEditor(w);
    return txt;
}


Generated by  Doxygen 1.6.0   Back to index