The QTableItem class provides content for one cell in a QTable. More...
List of all member functions.
A QTableItem contains the data of a table cell, specifies its edit type and the editor used to change its content. Furthermore, it defines its size, the alignment of the data to display, whether the data can be replaced, and provides the API needed for sorting table items.
Items may contain text and pixmaps and offer a QLineEdit for editing. By reimplementing paint(), key(), createEditor() and setContentFromEditor() you can change these default settings.
To get rid of an item, simply delete it. By doing so, all required actions for removing it from the table will be taken.
Always- the cell always is and always looks editable.
WhenCurrent- the cell is editable, and looks editable whenever it has keyboard focus (see QTable::setCurrentCell()).
OnTyping- the cell is editable, but looks editable only when the user types in it or double-clicks in it. (This is like
WhenCurrentin function but can look a bit cleaner.)
Never- the cell isn't editable.
Creates a table item for the table table that contains the text text.
Creates an item for the table table with the text text and the pixmap p.
The alignment function returns how the contents of the cell are drawn. The default implementation aligns numbers to the right and other text to the left.
Returns the column where the item is located. If the cell spans multiple columns, this function returns the leftmost column.
Returns teh column span of the item, normally 1.
See also setSpan().
This virtual function creates the editor with which the user can edit the cell. The default implementation creates a QLineEdit.
If the function returns 0, that the cell can not be edited.
The returned widget should preferably not be visible, and it should preferably have QTable::viewport() as parent.
If you reimplement this function, you probably also need to reimplement setContentFromEditor().
See also QTable::createEditor(), setContentFromEditor() and QTable::viewport().
Returns the edit type of an item.
See also EditType.
This function returns whether the relevant QTableItem can be replaced or not. Only items that cover no more than one cell might be replaced.
See also setReplaceable().
This virtual function returns the key that should be used for sorting. The default implementation returns the text() of the relevant item.
In order to paint the contents of an item call QTableItem::paint().
Returns the item's pixmap.
Returns the row where the item is located. If the cell spans multiple rows, this function returns the top row.
Returns the row span of an item, normally 1.
See also setSpan().
Sets the item's column to be c. Normally you will not need to call this function.
If the cell spans multiple columns, this function sets the leftmost column and retains the width.
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.
You probably must reimplement this function if you reimplement createEditor() and return something that is not a QLineEdit.
See also QTable::setContentFromEditor().
Sets the item pixmap to pix. QTableItem::setPixmap(), however, does not repaint the cell.
If it shouldn't be possible to replace the contents of the relevant cell with those of another QTableItem, set b to FALSE.
Sets the item's row to be row. Normally you will not need to call this function.
If the cell spans multiple rows, this function sets the top row and retains the height.
Creates a multi-cell QTableItem covering rs rows and cs columns. The top left corner of the item is at the item's former position.
Warning: This function only works, if the item has already been inserted into the table using e.g. QTable::setItem().
Changes the text of the item to str. Note that the cell is not repainted.
If b is TRUE, the cell's text is wrapped into multiple lines, otherwise it will be written on one line.
This virtual function returns the size a cell needs to show its entire content.
Many custom table items will need to reimplement this function.
Returns the QTable the item belongs to.
Provides the text of the item.
If word wrap has been turned on for the cell in question, wordWrap() is TRUE, otherwise it returns FALSE.
For internal use only.
Search the documentation, FAQ, qt-interest archive and more (uses
This file is part of the Qt toolkit, copyright © 1995-2005 Trolltech, all rights reserved.
|Copyright © 2005 Trolltech||Trademarks|
Qt version 2.3.10