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

The QListWidgetItem class provides an item for use with the QListWidget item view class. More...

Inheritance diagram for QtGui.QListWidgetItem:
Collaboration diagram for QtGui.QListWidgetItem:

Public Types

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

Public Member Functions

 QListWidgetItem (QListWidgetItem other)
 
 
 QListWidgetItem (QListWidget view=null, int type=(int) QListWidgetItem.ItemType.Type)
 
 
 QListWidgetItem (QIcon icon, string text, QListWidget view=null, int type=(int) QListWidgetItem.ItemType.Type)
 
 
 QListWidgetItem (string text, QListWidget view=null, int type=(int) QListWidgetItem.ItemType.Type)
 
 
virtual void CreateProxy ()
 
virtual QListWidgetItem Clone ()
 
 
virtual object Data (int role)
 
 
new bool IsHidden ()
 
 
new bool IsSelected ()
 
 
new QListWidget ListWidget ()
 
 
virtual void Read (QDataStream @in)
 
 
virtual void SetData (int role, object value)
 
 
new void SetHidden (bool hide)
 
 
new void SetSelected (bool select)
 
 
new int Type ()
 
 
virtual void Write (QDataStream @out)
 
 
new void Dispose ()
 

Static Public Member Functions

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

Protected Member Functions

 QListWidgetItem (System.Type dummy)
 

Protected Attributes

SmokeInvocation interceptor
 

Properties

new QBrush Background [get, set]
 
 
virtual 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 QListWidgetItem class provides an item for use with the QListWidget item view class.

A QListWidgetItem represents a single item in a QListWidget. Each item can hold several pieces of information, and will display them appropriately.

The item view convenience classes use a classic item-based interface rather than a pure model/view approach. For a more flexible list view widget, consider using the QListView class with a standard model.

List items can be inserted automatically into a list, when they are constructed, by specifying the list widget:

new QListWidgetItem(tr("Hazel"), listWidget);

Alternatively, list items can also be created without a parent widget, and later inserted into a list using QListWidget::insertItem().

List items are typically used to display text() and an icon(). These are set with the setText() and setIcon() functions. The appearance of the text can be customized with setFont(), setForeground(), and setBackground(). Text in list items can be aligned using the setTextAlignment() function. Tooltips, status tips and "What's This?" help can be added to list items with setToolTip(), setStatusTip(), and setWhatsThis().

By default, items are enabled, selectable, checkable, and can be the source of drag and drop operations.

Each item's flags can be changed by calling setFlags() with the appropriate value (see Qt::ItemFlags). Checkable items can be checked, unchecked and partially checked with the setCheckState() function. The corresponding checkState() function indicates the item's current check state.

The isHidden() function can be used to determine whether the item is hidden. To hide an item, use setHidden().

Subclassing

When subclassing QListWidgetItem to provide custom items, it is possible to define new types for them enabling them to be distinguished from standard items. For subclasses that require this feature, ensure that you call the base class constructor with a new type value equal to or greater than UserType, within your constructor.

See also QListWidget, Model/View Programming, QTreeWidgetItem, and QTableWidgetItem.

Member Enumeration Documentation

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

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

See also type().

Enumerator:
Type 

The default type for list widget items.

UserType 

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

Constructor & Destructor Documentation

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

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

This function is useful when reimplementing clone().

This function was introduced in Qt 4.1.

See also data() and flags().

QtGui.QListWidgetItem.QListWidgetItem ( QListWidget  view = null,
int  type = (int) QListWidgetItem.ItemType.Type 
)

Constructs an empty list widget item of the specified type with the given parent. If parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem().

This constructor inserts the item into the model of the parent that is passed to the constructor. If the model is sorted then the behavior of the insert is undetermined since the model will call the '<' operator method on the item which, at this point, is not yet constructed. To avoid the undetermined behavior, we recommend not to specify the parent and use QListWidget::insertItem() instead.

See also type().

QtGui.QListWidgetItem.QListWidgetItem ( QIcon  icon,
string  text,
QListWidget  view = null,
int  type = (int) QListWidgetItem.ItemType.Type 
)

Constructs an empty list widget item of the specified type with the given icon, text and parent. If the parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem().

This constructor inserts the item into the model of the parent that is passed to the constructor. If the model is sorted then the behavior of the insert is undetermined since the model will call the '<' operator method on the item which, at this point, is not yet constructed. To avoid the undetermined behavior, we recommend not to specify the parent and use QListWidget::insertItem() instead.

See also type().

QtGui.QListWidgetItem.QListWidgetItem ( string  text,
QListWidget  view = null,
int  type = (int) QListWidgetItem.ItemType.Type 
)

Constructs an empty list widget item of the specified type with the given text and parent. If the parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem().

This constructor inserts the item into the model of the parent that is passed to the constructor. If the model is sorted then the behavior of the insert is undetermined since the model will call the '<' operator method on the item which, at this point, is not yet constructed. To avoid the undetermined behavior, we recommend not to specify the parent and use QListWidget::insertItem() instead.

See also type().

Member Function Documentation

virtual QListWidgetItem QtGui.QListWidgetItem.Clone ( )
virtual

Creates an exact copy of the item.

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

Returns the item's data for a given role. Reimplement this function if you need extra roles or special behavior for certain roles.

See also Qt::ItemDataRole and setData().

new void QtGui.QListWidgetItem.Dispose ( )
new bool QtGui.QListWidgetItem.IsHidden ( )

Returns true if the item is hidden; otherwise returns false.

This function was introduced in Qt 4.2.

See also setHidden().

new bool QtGui.QListWidgetItem.IsSelected ( )

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

This function was introduced in Qt 4.2.

See also setSelected().

new QListWidget QtGui.QListWidgetItem.ListWidget ( )

Returns the list widget containing the item.

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

Returns true if this item's text is less then other item's text; otherwise returns false.

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

Reads the item from stream in.

See also write().

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

Sets the data for a given role to the given value. Reimplement this function if you need extra roles or special behavior for certain roles.

See also Qt::ItemDataRole and data().

new void QtGui.QListWidgetItem.SetHidden ( bool  hide)

Hides the item if hide is true; otherwise shows the item.

This function was introduced in Qt 4.2.

See also isHidden().

new void QtGui.QListWidgetItem.SetSelected ( bool  select)

Sets the selected state of the item to select.

This function was introduced in Qt 4.2.

See also isSelected().

new int QtGui.QListWidgetItem.Type ( )

Returns the type passed to the QListWidgetItem constructor.

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

Writes the item to stream out.

See also read().

Member Data Documentation

SmokeInvocation QtGui.QListWidgetItem.interceptor
protected

Property Documentation

new QBrush QtGui.QListWidgetItem.Background
getset

Returns the brush used to display the list item's background.

This function was introduced in Qt 4.2.

Sets the background brush of the list item to the given brush.

This function was introduced in Qt 4.2.

virtual QColor QtGui.QListWidgetItem.BackgroundColor
getset

This function is deprecated. Use background() instead.

This function is deprecated. Use setBackground() instead.

new Qt.CheckState QtGui.QListWidgetItem.CheckState
getset

Returns the checked state of the list item (see Qt::CheckState).

Sets the check state of the list item to state.

new Qt.ItemFlag QtGui.QListWidgetItem.Flags
getset

Returns the item flags for this item (see Qt::ItemFlags).

Sets the item flags for the list item to flags.

new QFont QtGui.QListWidgetItem.Font
getset

Returns the font used to display this list item's text.

Sets the font used when painting the item to the given font.

new QBrush QtGui.QListWidgetItem.Foreground
getset

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

This function was introduced in Qt 4.2.

Sets the foreground brush of the list item to the given brush.

This function was introduced in Qt 4.2.

new QIcon QtGui.QListWidgetItem.Icon
getset

Returns the list item's icon.

Sets the icon for the list item to the given icon.

new QSize QtGui.QListWidgetItem.SizeHint
getset

Returns the size hint set for the list item.

This function was introduced in Qt 4.1.

Sets the size hint for the list 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.QListWidgetItem.SmokeObject
getset
new string QtGui.QListWidgetItem.StatusTip
getset

Returns the list item's status tip.

Sets the status tip for the list item to the text specified by statusTip. QListWidget mouseTracking needs to be enabled for this feature to work.

new string QtGui.QListWidgetItem.Text
getset

Returns the list item's text.

Sets the text for the list widget item's to the given text.

new int QtGui.QListWidgetItem.TextAlignment
getset

Returns the text alignment for the list item.

Sets the list item's text alignment to alignment.

new QColor QtGui.QListWidgetItem.TextColor
getset

Returns the color used to display the list item's text.

This function is deprecated. Use foreground() instead.

This function is deprecated. Use setForeground() instead.

new string QtGui.QListWidgetItem.ToolTip
getset

Returns the list item's tooltip.

Sets the tooltip for the list item to the text specified by toolTip.

new string QtGui.QListWidgetItem.WhatsThis
getset

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

Sets the "What's This?" help for the list item to the text specified by whatsThis.