Qyoto  4.0.6
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtGui.QTableWidgetItem Class Reference

The QTableWidgetItem class provides an item for use with the QTableWidget class. More...

Inheritance diagram for QtGui.QTableWidgetItem:
Collaboration diagram for QtGui.QTableWidgetItem:

Public Types

enum  ItemType { Type = 0, UserType = 1000 }
  More...
 

Public Member Functions

 QTableWidgetItem (QTableWidgetItem other)
 
 
 QTableWidgetItem (QIcon icon, string text, int type=(int) QTableWidgetItem.ItemType.Type)
 
 
 QTableWidgetItem (int type=(int) QTableWidgetItem.ItemType.Type)
 
 
 QTableWidgetItem (string text, int type=(int) QTableWidgetItem.ItemType.Type)
 
 
virtual void CreateProxy ()
 
virtual object Data (int role)
 
 
virtual void Read (QDataStream @in)
 
 
virtual void SetData (int role, object value)
 
 
new void SetSelected (bool select)
 
 
virtual void Write (QDataStream @out)
 
 
new void Dispose ()
 

Static Public Member Functions

static bool operator< (QTableWidgetItem one, QTableWidgetItem other)
 
 
static bool operator> (QTableWidgetItem one, QTableWidgetItem other)
 

Protected Member Functions

 QTableWidgetItem (System.Type dummy)
 

Protected Attributes

SmokeInvocation interceptor
 

Properties

QBrush Background [get, set]
 
 
QColor BackgroundColor [get, set]
 
 
Qt.CheckState CheckState [get, set]
 
 
Qt.ItemFlag Flags [get, set]
 
 
QFont Font [get, set]
 
 
QBrush Foreground [get, set]
 
 
QIcon Icon [get, set]
 
 
QSize SizeHint [get, set]
 
 
string StatusTip [get, set]
 
 
string Text [get, set]
 
 
int TextAlignment [get, set]
 
 
QColor TextColor [get, set]
 
 
string ToolTip [get, set]
 
 
string WhatsThis [get, set]
 
 
virtual QTableWidgetItem Clone [get]
 
 
int Column [get]
 
 
bool IsSelected [get]
 
 
int Row [get]
 
 
QTableWidget TableWidget [get]
 
 
int Type [get]
 
 
virtual System.IntPtr SmokeObject [get, set]
 

Detailed Description

The QTableWidgetItem class provides an item for use with the QTableWidget class.

Table items are used to hold pieces of information for table widgets. Items usually contain text, icons, or checkboxes

The QTableWidgetItem class is a convenience class that replaces the QTableItem class in Qt 3. It provides an item for use with the QTableWidget class.

Top-level items are constructed without a parent then inserted at the position specified by a pair of row and column numbers:

QTableWidgetItem *newItem = new QTableWidgetItem(tr("%1").arg(

pow(row, column+1)));

tableWidget->setItem(row, column, newItem);

Each item can have its own background brush which is set with the setBackground() function. The current background brush can be found with background(). The text label for each item can be rendered with its own font and brush. These are specified with the setFont() and setForeground() functions, and read with font() and foreground().

By default, items are enabled, editable, selectable, checkable, and can be used both as the source of a drag and drop operation and as a drop target. Each item's flags can be changed by calling setFlags() with the appropriate value (see Qt::ItemFlags). Checkable items can be checked and unchecked with the setCheckState() function. The corresponding checkState() function indicates whether the item is currently checked.

Subclassing

When subclassing QTableWidgetItem to provide custom items, it is possible to define new types for them so that they can be distinguished from standard items. The constructors for subclasses that require this feature need to call the base class constructor with a new type value equal to or greater than UserType.

See also QTableWidget, Model/View Programming, QListWidgetItem, and QTreeWidgetItem.

Member Enumeration Documentation

This enum describes the types that are used to describe table widget items.

You can define new user types in QTableWidgetItem subclasses to ensure that custom items are treated specially.

See also type().

Enumerator:
Type 

The default type for table widget items.

UserType 

The minimum value for custom types. Values below UserType are reserved by Qt.

Constructor & Destructor Documentation

QtGui.QTableWidgetItem.QTableWidgetItem ( System.Type  dummy)
protected
QtGui.QTableWidgetItem.QTableWidgetItem ( QTableWidgetItem  other)

Constructs a copy of other. Note that type() and tableWidget() are not copied.

This function is useful when reimplementing clone().

This function was introduced in Qt 4.1.

See also data() and flags().

QtGui.QTableWidgetItem.QTableWidgetItem ( QIcon  icon,
string  text,
int  type = (int) QTableWidgetItem.ItemType.Type 
)

Constructs a table item with the given icon and text.

See also type().

QtGui.QTableWidgetItem.QTableWidgetItem ( int  type = (int) QTableWidgetItem.ItemType.Type)

Constructs a table item of the specified type that does not belong to any table.

See also type().

QtGui.QTableWidgetItem.QTableWidgetItem ( string  text,
int  type = (int) QTableWidgetItem.ItemType.Type 
)

Constructs a table item with the given text.

See also type().

Member Function Documentation

virtual void QtGui.QTableWidgetItem.CreateProxy ( )
virtual
virtual object QtGui.QTableWidgetItem.Data ( int  role)
virtual

Returns the item's data for the given role.

See also setData().

new void QtGui.QTableWidgetItem.Dispose ( )
static bool QtGui.QTableWidgetItem.operator< ( QTableWidgetItem  one,
QTableWidgetItem  other 
)
static

Returns true if the item is less than the other item; otherwise returns false.

static bool QtGui.QTableWidgetItem.operator> ( QTableWidgetItem  one,
QTableWidgetItem  other 
)
static
virtual void QtGui.QTableWidgetItem.Read ( QDataStream in)
virtual

Reads the item from stream in.

See also write().

virtual void QtGui.QTableWidgetItem.SetData ( int  role,
object  value 
)
virtual

Sets the item's data for the given role to the specified value.

See also Qt::ItemDataRole and data().

new void QtGui.QTableWidgetItem.SetSelected ( bool  select)

Sets the selected state of the item to select.

This function was introduced in Qt 4.2.

See also isSelected().

virtual void QtGui.QTableWidgetItem.Write ( QDataStream out)
virtual

Writes the item to stream out.

See also read().

Member Data Documentation

SmokeInvocation QtGui.QTableWidgetItem.interceptor
protected

Property Documentation

QBrush QtGui.QTableWidgetItem.Background
getset

Returns the brush used to render the item's background.

This function was introduced in Qt 4.2.

Sets the item's background brush to the specified brush.

This function was introduced in Qt 4.2.

QColor QtGui.QTableWidgetItem.BackgroundColor
getset

This function is deprecated. Use background() instead.

This function is deprecated. Use setBackground() instead.

Qt.CheckState QtGui.QTableWidgetItem.CheckState
getset

Returns the checked state of the table item.

Sets the check state of the table item to be state.

virtual QTableWidgetItem QtGui.QTableWidgetItem.Clone
get

Creates a copy of the item.

int QtGui.QTableWidgetItem.Column
get

Returns the column of the item in the table. If the item is not in a table, this function will return -1.

This function was introduced in Qt 4.2.

See also row().

Qt.ItemFlag QtGui.QTableWidgetItem.Flags
getset

Returns the flags used to describe the item. These determine whether the item can be checked, edited, and selected.

Sets the flags for the item to the given flags. These determine whether the item can be selected or modified.

QFont QtGui.QTableWidgetItem.Font
getset

Returns the font used to render the item's text.

Sets the font used to display the item's text to the given font.

QBrush QtGui.QTableWidgetItem.Foreground
getset

Returns the brush used to render the item's foreground (e.g. text).

This function was introduced in Qt 4.2.

Sets the item's foreground brush to the specified brush.

This function was introduced in Qt 4.2.

QIcon QtGui.QTableWidgetItem.Icon
getset

Returns the item's icon.

Sets the item's icon to the icon specified.

bool QtGui.QTableWidgetItem.IsSelected
get

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

This function was introduced in Qt 4.2.

See also setSelected().

int QtGui.QTableWidgetItem.Row
get

Returns the row of the item in the table. If the item is not in a table, this function will return -1.

This function was introduced in Qt 4.2.

See also column().

QSize QtGui.QTableWidgetItem.SizeHint
getset

Returns the size hint set for the table item.

This function was introduced in Qt 4.1.

Sets the size hint for the table item to be size. If no size hint is set, the item delegate will compute the size hint based on the item data.

This function was introduced in Qt 4.1.

virtual System.IntPtr QtGui.QTableWidgetItem.SmokeObject
getset
string QtGui.QTableWidgetItem.StatusTip
getset

Returns the item's status tip.

Sets the status tip for the table item to the text specified by statusTip. QTableWidget mouse tracking needs to be enabled for this feature to work.

QTableWidget QtGui.QTableWidgetItem.TableWidget
get

Returns the table widget that contains the item.

string QtGui.QTableWidgetItem.Text
getset

Returns the item's text.

Sets the item's text to the text specified.

int QtGui.QTableWidgetItem.TextAlignment
getset

Returns the text alignment for the item's text.

Sets the text alignment for the item's text to the alignment specified.

QColor QtGui.QTableWidgetItem.TextColor
getset

This function is deprecated. Use foreground() instead.

This function is deprecated. Use setForeground() instead.

string QtGui.QTableWidgetItem.ToolTip
getset

Returns the item's tooltip.

Sets the item's tooltip to the string specified by toolTip.

int QtGui.QTableWidgetItem.Type
get

Returns the type passed to the QTableWidgetItem constructor.

string QtGui.QTableWidgetItem.WhatsThis
getset

Returns the item's "What's This?" help.

Sets the item's "What's This?" help to the string specified by whatsThis.