Qyoto  4.0.5
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 QTableWidgetItem Clone ()
 
 
new int Column ()
 
 
virtual object Data (int role)
 
 
new bool IsSelected ()
 
 
virtual void Read (QDataStream @in)
 
 
new int Row ()
 
 
virtual void SetData (int role, object value)
 
 
new void SetSelected (bool select)
 
 
new QTableWidget TableWidget ()
 
 
new int Type ()
 
 
virtual void Write (QDataStream @out)
 
 
new void Dispose ()
 

Static Public Member Functions

static bool operator< (QTableWidgetItem arg1, QTableWidgetItem arg2)
 
 
static bool operator> (QTableWidgetItem arg1, QTableWidgetItem arg2)
 

Protected Member Functions

 QTableWidgetItem (System.Type dummy)
 

Protected Attributes

SmokeInvocation interceptor
 

Properties

new QBrush Background [get, set]
 
 
new QColor BackgroundColor [get, set]
 
 
new Qt.CheckState CheckState [get, set]
 
 
new Qt.ItemFlag Flags [get, set]
 
 
new QFont Font [get, set]
 
 
new QBrush Foreground [get, set]
 
 
new QIcon Icon [get, set]
 
 
new QSize SizeHint [get, set]
 
 
new string StatusTip [get, set]
 
 
new string Text [get, set]
 
 
new int TextAlignment [get, set]
 
 
new QColor TextColor [get, set]
 
 
new string ToolTip [get, set]
 
 
new string WhatsThis [get, set]
 
 
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 QTableWidgetItem QtGui.QTableWidgetItem.Clone ( )
virtual

Creates a copy of the item.

new int QtGui.QTableWidgetItem.Column ( )

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().

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 ( )
new bool QtGui.QTableWidgetItem.IsSelected ( )

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

This function was introduced in Qt 4.2.

See also setSelected().

static bool QtGui.QTableWidgetItem.operator< ( QTableWidgetItem  arg1,
QTableWidgetItem  arg2 
)
static

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

static bool QtGui.QTableWidgetItem.operator> ( QTableWidgetItem  arg1,
QTableWidgetItem  arg2 
)
static
virtual void QtGui.QTableWidgetItem.Read ( QDataStream in)
virtual

Reads the item from stream in.

See also write().

new int QtGui.QTableWidgetItem.Row ( )

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().

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().

new QTableWidget QtGui.QTableWidgetItem.TableWidget ( )

Returns the table widget that contains the item.

new int QtGui.QTableWidgetItem.Type ( )

Returns the type passed to the QTableWidgetItem constructor.

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

new 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.

new QColor QtGui.QTableWidgetItem.BackgroundColor
getset

This function is deprecated. Use background() instead.

This function is deprecated. Use setBackground() instead.

new 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.

new 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.

new 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.

new 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.

new QIcon QtGui.QTableWidgetItem.Icon
getset

Returns the item's icon.

Sets the item's icon to the icon specified.

new 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
new 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.

new string QtGui.QTableWidgetItem.Text
getset

Returns the item's text.

Sets the item's text to the text specified.

new 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.

new QColor QtGui.QTableWidgetItem.TextColor
getset

This function is deprecated. Use foreground() instead.

This function is deprecated. Use setForeground() instead.

new string QtGui.QTableWidgetItem.ToolTip
getset

Returns the item's tooltip.

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

new 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.