Qyoto  4.0.7
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator 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)
  More...
 
 QListWidgetItem (QListWidget view=null, int type=(int) QListWidgetItem.ItemType.Type)
  More...
 
 QListWidgetItem (QIcon icon, string text, QListWidget view=null, int type=(int) QListWidgetItem.ItemType.Type)
  More...
 
 QListWidgetItem (string text, QListWidget view=null, int type=(int) QListWidgetItem.ItemType.Type)
  More...
 
virtual void CreateProxy ()
 
virtual object Data (int role)
  More...
 
virtual void Read (QDataStream @in)
  More...
 
virtual void SetData (int role, object value)
  More...
 
new void SetHidden (bool hide)
  More...
 
new void SetSelected (bool select)
  More...
 
virtual void Write (QDataStream @out)
  More...
 
new void Dispose ()
 

Static Public Member Functions

static bool operator< (QListWidgetItem one, QListWidgetItem other)
  More...
 
static bool operator> (QListWidgetItem one, QListWidgetItem other)
 

Protected Member Functions

 QListWidgetItem (System.Type dummy)
 

Protected Attributes

SmokeInvocation interceptor
 

Properties

QBrush Background [get, set]
  More...
 
virtual QColor BackgroundColor [get, set]
  More...
 
Qt.CheckState CheckState [get, set]
  More...
 
Qt.ItemFlag Flags [get, set]
  More...
 
QFont Font [get, set]
  More...
 
QBrush Foreground [get, set]
  More...
 
QIcon Icon [get, set]
  More...
 
QSize SizeHint [get, set]
  More...
 
string StatusTip [get, set]
  More...
 
string Text [get, set]
  More...
 
int TextAlignment [get, set]
  More...
 
QColor TextColor [get, set]
  More...
 
string ToolTip [get, set]
  More...
 
string WhatsThis [get, set]
  More...
 
virtual QListWidgetItem Clone [get]
  More...
 
bool IsHidden [get]
  More...
 
bool IsSelected [get]
  More...
 
QListWidget ListWidget [get]
  More...
 
int Type [get]
  More...
 
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().

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

Member Function Documentation

virtual void QtGui.QListWidgetItem.CreateProxy ( )
virtual

Here is the caller graph for this function:

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 ( )
static bool QtGui.QListWidgetItem.operator< ( QListWidgetItem  one,
QListWidgetItem  other 
)
static

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

static bool QtGui.QListWidgetItem.operator> ( QListWidgetItem  one,
QListWidgetItem  other 
)
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().

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

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.

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.

virtual QListWidgetItem QtGui.QListWidgetItem.Clone
get

Creates an exact copy of the item.

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.

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.

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.

QIcon QtGui.QListWidgetItem.Icon
getset

Returns the list item's icon.

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

bool QtGui.QListWidgetItem.IsHidden
get

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

This function was introduced in Qt 4.2.

See also setHidden().

bool QtGui.QListWidgetItem.IsSelected
get

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

This function was introduced in Qt 4.2.

See also setSelected().

QListWidget QtGui.QListWidgetItem.ListWidget
get

Returns the list widget containing the item.

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

string QtGui.QListWidgetItem.Text
getset

Returns the list item's text.

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

int QtGui.QListWidgetItem.TextAlignment
getset

Returns the text alignment for the list item.

Sets the list item's text alignment to alignment.

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.

string QtGui.QListWidgetItem.ToolTip
getset

Returns the list item's tooltip.

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

int QtGui.QListWidgetItem.Type
get

Returns the type passed to the QListWidgetItem constructor.

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.