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

The QTreeWidgetItem class provides an item for use with the QTreeWidget convenience class. More...

Inheritance diagram for QtGui.QTreeWidgetItem:
Collaboration diagram for QtGui.QTreeWidgetItem:

Public Types

enum  ChildIndicatorPolicy { DontShowIndicator = 1, DontShowIndicatorWhenChildless = 2, ShowIndicator = 0 }
  More...
 
enum  ItemType { Type = 0, UserType = 1000 }
  More...
 

Public Member Functions

 QTreeWidgetItem (QTreeWidget view, QTreeWidgetItem after, int type=(int) QTreeWidgetItem.ItemType.Type)
  More...
 
 QTreeWidgetItem (QTreeWidgetItem parent, QTreeWidgetItem after, int type=(int) QTreeWidgetItem.ItemType.Type)
  More...
 
 QTreeWidgetItem (QTreeWidget view, int type=(int) QTreeWidgetItem.ItemType.Type)
  More...
 
 QTreeWidgetItem (QTreeWidgetItem parent, int type=(int) QTreeWidgetItem.ItemType.Type)
  More...
 
 QTreeWidgetItem (QTreeWidget view, System.Collections.Generic.List< string > strings, int type=(int) QTreeWidgetItem.ItemType.Type)
  More...
 
 QTreeWidgetItem (QTreeWidgetItem parent, System.Collections.Generic.List< string > strings, int type=(int) QTreeWidgetItem.ItemType.Type)
  More...
 
 QTreeWidgetItem (int type=(int) QTreeWidgetItem.ItemType.Type)
  More...
 
 QTreeWidgetItem (System.Collections.Generic.List< string > strings, int type=(int) QTreeWidgetItem.ItemType.Type)
  More...
 
virtual void CreateProxy ()
 
new void AddChild (QTreeWidgetItem child)
  More...
 
new void AddChildren (System.Collections.Generic.List< QTreeWidgetItem > children)
  More...
 
new QBrush Background (int column)
  More...
 
new QColor BackgroundColor (int column)
  More...
 
new Qt.CheckState CheckState (int column)
  More...
 
new QTreeWidgetItem Child (int index)
  More...
 
virtual object Data (int column, int role)
  More...
 
new QFont Font (int column)
  More...
 
new QBrush Foreground (int column)
  More...
 
new QIcon Icon (int column)
  More...
 
new int IndexOfChild (QTreeWidgetItem child)
  More...
 
new void InsertChild (int index, QTreeWidgetItem child)
  More...
 
new void InsertChildren (int index, System.Collections.Generic.List< QTreeWidgetItem > children)
  More...
 
virtual void Read (QDataStream @in)
  More...
 
new void RemoveChild (QTreeWidgetItem child)
  More...
 
new void SetBackground (int column, QBrush brush)
  More...
 
new void SetBackgroundColor (int column, QColor color)
  More...
 
new void SetCheckState (int column, Qt.CheckState state)
  More...
 
virtual void SetData (int column, int role, object value)
  More...
 
new void SetDisabled (bool disabled)
  More...
 
new void SetExpanded (bool expand)
  More...
 
new void SetFirstColumnSpanned (bool span)
  More...
 
new void SetFont (int column, QFont font)
  More...
 
new void SetForeground (int column, QBrush brush)
  More...
 
new void SetHidden (bool hide)
  More...
 
new void SetIcon (int column, QIcon icon)
  More...
 
new void SetSelected (bool select)
  More...
 
new void SetSizeHint (int column, QSize size)
  More...
 
new void SetStatusTip (int column, string statusTip)
  More...
 
new void SetText (int column, string text)
  More...
 
new void SetTextAlignment (int column, int alignment)
  More...
 
new void SetTextColor (int column, QColor color)
  More...
 
new void SetToolTip (int column, string toolTip)
  More...
 
new void SetWhatsThis (int column, string whatsThis)
  More...
 
new QSize SizeHint (int column)
  More...
 
new void SortChildren (int column, Qt.SortOrder order)
  More...
 
new string StatusTip (int column)
  More...
 
new QTreeWidgetItem TakeChild (int index)
  More...
 
new
System.Collections.Generic.List
< QTreeWidgetItem
TakeChildren ()
  More...
 
new string Text (int column)
  More...
 
new int TextAlignment (int column)
  More...
 
new QColor TextColor (int column)
  More...
 
new string ToolTip (int column)
  More...
 
new string WhatsThis (int column)
  More...
 
virtual void Write (QDataStream @out)
  More...
 
new void Dispose ()
 

Static Public Member Functions

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

Protected Member Functions

 QTreeWidgetItem (System.Type dummy)
 
new void EmitDataChanged ()
  More...
 

Protected Attributes

SmokeInvocation interceptor
 

Properties

QTreeWidgetItem.ChildIndicatorPolicy childIndicatorPolicy [get, set]
  More...
 
Qt.ItemFlag Flags [get, set]
  More...
 
int ChildCount [get]
  More...
 
virtual QTreeWidgetItem Clone [get]
  More...
 
int ColumnCount [get]
  More...
 
bool IsDisabled [get]
  More...
 
bool IsExpanded [get]
  More...
 
bool IsFirstColumnSpanned [get]
  More...
 
bool IsHidden [get]
  More...
 
bool IsSelected [get]
  More...
 
QTreeWidgetItem Parent [get]
  More...
 
QTreeWidget TreeWidget [get]
  More...
 
int Type [get]
  More...
 
virtual System.IntPtr SmokeObject [get, set]
 

Detailed Description

The QTreeWidgetItem class provides an item for use with the QTreeWidget convenience class.

Tree widget items are used to hold rows of information for tree widgets. Rows usually contain several columns of data, each of which can contain a text label and an icon.

The QTreeWidgetItem class is a convenience class that replaces the QListViewItem class in Qt 3. It provides an item for use with the QTreeWidget class.

Items are usually constructed with a parent that is either a QTreeWidget (for top-level items) or a QTreeWidgetItem (for items on lower levels of the tree). For example, the following code constructs a top-level item to represent cities of the world, and adds a entry for Oslo as a child item:

QTreeWidgetItem *cities = new QTreeWidgetItem(treeWidget);

cities->setText(0, tr("Cities"));

QTreeWidgetItem *osloItem = new QTreeWidgetItem(cities);

osloItem->setText(0, tr("Oslo"));

osloItem->setText(1, tr("Yes"));

Items can be added in a particular order by specifying the item they follow when they are constructed:

QTreeWidgetItem *planets = new QTreeWidgetItem(treeWidget, cities);

planets->setText(0, tr("Planets"));

Each column in an 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 column can be rendered with its own font and brush. These are specified with the setFont() and setForeground() functions, and read with font() and foreground().

The main difference between top-level items and those in lower levels of the tree is that a top-level item has no parent(). This information can be used to tell the difference between items, and is useful to know when inserting and removing items from the tree. Children of an item can be removed with takeChild() and inserted at a given index in the list of children with the insertChild() function.

By default, items are enabled, selectable, checkable, and can be the source of a drag and drop operation. 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 QTreeWidgetItem 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 QTreeWidget, QTreeWidgetItemIterator, Model/View Programming, QListWidgetItem, and QTableWidgetItem.

Member Enumeration Documentation

This enum was introduced or modified in Qt 4.3.

Enumerator
DontShowIndicator 

The controls for expanding and collapsing will never be shown even if there are children. If the node is forced open the user will not be able to expand or collapse the item.

DontShowIndicatorWhenChildless 

The controls for expanding and collapsing will be shown if the item contains children.

ShowIndicator 

The controls for expanding and collapsing will be shown for this item even if there are no children.

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

You can define new user types in QTreeWidgetItem subclasses to ensure that custom items are treated specially; for example, when items are sorted.

See also type().

Enumerator
Type 

The default type for tree widget items.

UserType 

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

Constructor & Destructor Documentation

QtGui.QTreeWidgetItem.QTreeWidgetItem ( System.Type  dummy)
protected
QtGui.QTreeWidgetItem.QTreeWidgetItem ( QTreeWidget  view,
QTreeWidgetItem  after,
int  type = (int) QTreeWidgetItem.ItemType.Type 
)

Constructs a tree widget item of the specified type and inserts it into the given parent after the preceding item.

See also type().

Here is the call graph for this function:

QtGui.QTreeWidgetItem.QTreeWidgetItem ( QTreeWidgetItem  parent,
QTreeWidgetItem  after,
int  type = (int) QTreeWidgetItem.ItemType.Type 
)

Constructs a tree widget item of the specified type that is inserted into the parent after the preceding child item.

See also type().

Here is the call graph for this function:

QtGui.QTreeWidgetItem.QTreeWidgetItem ( QTreeWidget  view,
int  type = (int) QTreeWidgetItem.ItemType.Type 
)

Constructs a tree widget item of the specified type and appends it to the items in the given parent.

See also type().

Here is the call graph for this function:

QtGui.QTreeWidgetItem.QTreeWidgetItem ( QTreeWidgetItem  parent,
int  type = (int) QTreeWidgetItem.ItemType.Type 
)

Constructs a tree widget item and append it to the given parent.

See also type().

Here is the call graph for this function:

QtGui.QTreeWidgetItem.QTreeWidgetItem ( QTreeWidget  view,
System.Collections.Generic.List< string >  strings,
int  type = (int) QTreeWidgetItem.ItemType.Type 
)

Constructs a tree widget item of the specified type and appends it to the items in the given parent. The given list of strings will be set as the item text for each column in the item.

See also type().

Here is the call graph for this function:

QtGui.QTreeWidgetItem.QTreeWidgetItem ( QTreeWidgetItem  parent,
System.Collections.Generic.List< string >  strings,
int  type = (int) QTreeWidgetItem.ItemType.Type 
)

Constructs a tree widget item and append it to the given parent. The given list of strings will be set as the item text for each column in the item.

See also type().

Here is the call graph for this function:

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

Constructs a tree widget item of the specified type. The item must be inserted into a tree widget.

See also type().

Here is the call graph for this function:

QtGui.QTreeWidgetItem.QTreeWidgetItem ( System.Collections.Generic.List< string >  strings,
int  type = (int) QTreeWidgetItem.ItemType.Type 
)

Constructs a tree widget item of the specified type. The item must be inserted into a tree widget. The given list of strings will be set as the item text for each column in the item.

See also type().

Here is the call graph for this function:

Member Function Documentation

new void QtGui.QTreeWidgetItem.AddChild ( QTreeWidgetItem  child)

Appends the child item to the list of children.

See also insertChild() and takeChild().

new void QtGui.QTreeWidgetItem.AddChildren ( System.Collections.Generic.List< QTreeWidgetItem children)

Appends the given list of children to the item.

This function was introduced in Qt 4.1.

See also insertChildren() and takeChildren().

new QBrush QtGui.QTreeWidgetItem.Background ( int  column)

Returns the brush used to render the background of the specified column.

This function was introduced in Qt 4.2.

See also setBackground() and foreground().

new QColor QtGui.QTreeWidgetItem.BackgroundColor ( int  column)

This function is deprecated. Use background() instead.

See also setBackgroundColor().

new Qt.CheckState QtGui.QTreeWidgetItem.CheckState ( int  column)

Returns the check state of the label in the given column.

See also setCheckState() and Qt::CheckState.

new QTreeWidgetItem QtGui.QTreeWidgetItem.Child ( int  index)

Returns the item at the given index in the list of the item's children.

See also parent().

virtual void QtGui.QTreeWidgetItem.CreateProxy ( )
virtual

Here is the caller graph for this function:

virtual object QtGui.QTreeWidgetItem.Data ( int  column,
int  role 
)
virtual

Returns the value for the item's column and role.

See also setData().

new void QtGui.QTreeWidgetItem.Dispose ( )
new void QtGui.QTreeWidgetItem.EmitDataChanged ( )
protected

Causes the model associated with this item to emit a dataChanged() signal for this item.

You normally only need to call this function if you have subclassed QTreeWidgetItem and reimplemented data() and/or setData().

This function was introduced in Qt 4.5.

See also setData().

new QFont QtGui.QTreeWidgetItem.Font ( int  column)

Returns the font used to render the text in the specified column.

See also setFont().

new QBrush QtGui.QTreeWidgetItem.Foreground ( int  column)

Returns the brush used to render the foreground (e.g. text) of the specified column.

This function was introduced in Qt 4.2.

See also setForeground() and background().

new QIcon QtGui.QTreeWidgetItem.Icon ( int  column)

Returns the icon that is displayed in the specified column.

See also setIcon() and iconSize.

new int QtGui.QTreeWidgetItem.IndexOfChild ( QTreeWidgetItem  child)

Returns the index of the given child in the item's list of children.

new void QtGui.QTreeWidgetItem.InsertChild ( int  index,
QTreeWidgetItem  child 
)

Inserts the child item at index in the list of children.

If the child has already been inserted somewhere else it wont be inserted again.

new void QtGui.QTreeWidgetItem.InsertChildren ( int  index,
System.Collections.Generic.List< QTreeWidgetItem children 
)

Inserts the given list of children into the list of the item children at index .

Children that have already been inserted somewhere else wont be inserted.

This function was introduced in Qt 4.1.

static bool QtGui.QTreeWidgetItem.operator< ( QTreeWidgetItem  one,
QTreeWidgetItem  other 
)
static

Returns true if the text in the item is less than the text in the other item, otherwise returns false.

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

Reads the item from stream in. This only reads data into a single item.

See also write().

new void QtGui.QTreeWidgetItem.RemoveChild ( QTreeWidgetItem  child)

Removes the given item indicated by child. The removed item will not be deleted.

new void QtGui.QTreeWidgetItem.SetBackground ( int  column,
QBrush  brush 
)

Sets the background brush of the label in the given column to the specified brush.

This function was introduced in Qt 4.2.

See also background() and setForeground().

new void QtGui.QTreeWidgetItem.SetBackgroundColor ( int  column,
QColor  color 
)

This function is deprecated. Use setBackground() instead.

See also backgroundColor().

new void QtGui.QTreeWidgetItem.SetCheckState ( int  column,
Qt.CheckState  state 
)

Sets the item in the given column check state to be state.

See also checkState().

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

Sets the value for the item's column and role to the given value.

The role describes the type of data specified by value, and is defined by the Qt::ItemDataRole enum.

See also data().

new void QtGui.QTreeWidgetItem.SetDisabled ( bool  disabled)

Disables the item if disabled is true; otherwise enables the item.

This function was introduced in Qt 4.3.

See also isDisabled() and setFlags().

new void QtGui.QTreeWidgetItem.SetExpanded ( bool  expand)

Expands the item if expand is true, otherwise collapses the item.

Warning: The QTreeWidgetItem must be added to the QTreeWidget before calling this function.

This function was introduced in Qt 4.2.

See also isExpanded().

new void QtGui.QTreeWidgetItem.SetFirstColumnSpanned ( bool  span)

Sets the first section to span all columns if span is true; otherwise all item sections are shown.

This function was introduced in Qt 4.3.

See also isFirstColumnSpanned().

new void QtGui.QTreeWidgetItem.SetFont ( int  column,
QFont  font 
)

Sets the font used to display the text in the given column to the given font.

See also font(), setText(), and setForeground().

new void QtGui.QTreeWidgetItem.SetForeground ( int  column,
QBrush  brush 
)

Sets the foreground brush of the label in the given column to the specified brush.

This function was introduced in Qt 4.2.

See also foreground() and setBackground().

new void QtGui.QTreeWidgetItem.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.QTreeWidgetItem.SetIcon ( int  column,
QIcon  icon 
)

Sets the icon to be displayed in the given column to icon.

See also icon(), setText(), and iconSize.

new void QtGui.QTreeWidgetItem.SetSelected ( bool  select)

Sets the selected state of the item to select.

This function was introduced in Qt 4.2.

See also isSelected().

new void QtGui.QTreeWidgetItem.SetSizeHint ( int  column,
QSize  size 
)

Sets the size hint for the tree item in the given column 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.

See also sizeHint().

new void QtGui.QTreeWidgetItem.SetStatusTip ( int  column,
string  statusTip 
)

Sets the status tip for the given column to the given statusTip. QTreeWidget mouse tracking needs to be enabled for this feature to work.

See also statusTip(), setToolTip(), and setWhatsThis().

new void QtGui.QTreeWidgetItem.SetText ( int  column,
string  text 
)

Sets the text to be displayed in the given column to the given text.

See also text(), setFont(), and setForeground().

new void QtGui.QTreeWidgetItem.SetTextAlignment ( int  column,
int  alignment 
)

Sets the text alignment for the label in the given column to the alignment specified (see Qt::AlignmentFlag).

See also textAlignment().

new void QtGui.QTreeWidgetItem.SetTextColor ( int  column,
QColor  color 
)

This function is deprecated. Use setForeground() instead.

See also textColor().

new void QtGui.QTreeWidgetItem.SetToolTip ( int  column,
string  toolTip 
)

Sets the tooltip for the given column to toolTip.

See also toolTip(), setStatusTip(), and setWhatsThis().

new void QtGui.QTreeWidgetItem.SetWhatsThis ( int  column,
string  whatsThis 
)

Sets the "What's This?" help for the given column to whatsThis.

See also whatsThis(), setStatusTip(), and setToolTip().

new QSize QtGui.QTreeWidgetItem.SizeHint ( int  column)

Returns the size hint set for the tree item in the given column (see QSize).

This function was introduced in Qt 4.1.

See also setSizeHint().

new void QtGui.QTreeWidgetItem.SortChildren ( int  column,
Qt.SortOrder  order 
)

Sorts the children of the item using the given order, by the values in the given column.

Note: This function does nothing if the item is not associated with a QTreeWidget.

This function was introduced in Qt 4.2.

new string QtGui.QTreeWidgetItem.StatusTip ( int  column)

Returns the status tip for the contents of the given column.

See also setStatusTip().

new QTreeWidgetItem QtGui.QTreeWidgetItem.TakeChild ( int  index)

Removes the item at index and returns it, otherwise return 0.

new System.Collections.Generic.List<QTreeWidgetItem> QtGui.QTreeWidgetItem.TakeChildren ( )

Removes the list of children and returns it, otherwise returns an empty list.

This function was introduced in Qt 4.1.

new string QtGui.QTreeWidgetItem.Text ( int  column)

Returns the text in the specified column.

See also setText().

new int QtGui.QTreeWidgetItem.TextAlignment ( int  column)

Returns the text alignment for the label in the given column (see Qt::AlignmentFlag).

See also setTextAlignment().

new QColor QtGui.QTreeWidgetItem.TextColor ( int  column)

This function is deprecated. Use foreground() instead.

See also setTextColor().

new string QtGui.QTreeWidgetItem.ToolTip ( int  column)

Returns the tool tip for the given column.

See also setToolTip().

new string QtGui.QTreeWidgetItem.WhatsThis ( int  column)

Returns the "What's This?" help for the contents of the given column.

See also setWhatsThis().

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

Writes the item to stream out. This only writes data from one single item.

See also read().

Member Data Documentation

SmokeInvocation QtGui.QTreeWidgetItem.interceptor
protected

Property Documentation

int QtGui.QTreeWidgetItem.ChildCount
get

Returns the number of child items.

QTreeWidgetItem.ChildIndicatorPolicy QtGui.QTreeWidgetItem.childIndicatorPolicy
getset

Returns the item indicator policy. This policy decides when the tree branch expand/collapse indicator is shown.

Sets the item indicator policy. This policy decides when the tree branch expand/collapse indicator is shown. The default value is ShowForChildren.

virtual QTreeWidgetItem QtGui.QTreeWidgetItem.Clone
get

Creates a deep copy of the item and of its children.

int QtGui.QTreeWidgetItem.ColumnCount
get

Returns the number of columns in the item.

Qt.ItemFlag QtGui.QTreeWidgetItem.Flags
getset

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

The default value for flags is Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled. If the item was constructed with a parent, flags will in addition contain Qt::ItemIsDropEnabled.

Sets the flags for the item to the given flags. These determine whether the item can be selected or modified. This is often used to disable an item.

bool QtGui.QTreeWidgetItem.IsDisabled
get

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

This function was introduced in Qt 4.3.

See also setFlags().

bool QtGui.QTreeWidgetItem.IsExpanded
get

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

This function was introduced in Qt 4.2.

See also setExpanded().

bool QtGui.QTreeWidgetItem.IsFirstColumnSpanned
get

Returns true if the item is spanning all the columns in a row; otherwise returns false.

This function was introduced in Qt 4.3.

See also setFirstColumnSpanned().

bool QtGui.QTreeWidgetItem.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.QTreeWidgetItem.IsSelected
get

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

This function was introduced in Qt 4.2.

See also setSelected().

QTreeWidgetItem QtGui.QTreeWidgetItem.Parent
get

Returns the item's parent.

See also child().

virtual System.IntPtr QtGui.QTreeWidgetItem.SmokeObject
getset
QTreeWidget QtGui.QTreeWidgetItem.TreeWidget
get

Returns the tree widget that contains the item.

int QtGui.QTreeWidgetItem.Type
get

Returns the type passed to the QTreeWidgetItem constructor.