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

The QItemSelection class manages information about selected items in a model. More...

Inheritance diagram for QtGui.QItemSelection:
Collaboration diagram for QtGui.QItemSelection:

Public Member Functions

 QItemSelection ()
 
 
 QItemSelection (QItemSelection copy)
 
 
 QItemSelection (QModelIndex topLeft, QModelIndex bottomRight)
 
 
virtual void CreateProxy ()
 
new bool Contains (QModelIndex index)
 
 
new
System.Collections.Generic.List
< QModelIndex
Indexes ()
 
 
new void Merge (QItemSelection other, QItemSelectionModel.SelectionFlag command)
 
 
new void Select (QModelIndex topLeft, QModelIndex bottomRight)
 
 
new void Dispose ()
 

Static Public Member Functions

static void Split (QItemSelectionRange range, QItemSelectionRange other, QItemSelection result)
 
 

Protected Member Functions

 QItemSelection (System.Type dummy)
 

Protected Attributes

SmokeInvocation interceptor
 

Properties

virtual System.IntPtr SmokeObject [get, set]
 

Detailed Description

The QItemSelection class manages information about selected items in a model.

A QItemSelection describes the items in a model that have been selected by the user. A QItemSelection is basically a list of selection ranges, see QItemSelectionRange. It provides functions for creating and manipulating selections, and selecting a range of items from a model.

The QItemSelection class is one of the Model/View Classes and is part of Qt's model/view framework.

An item selection can be constructed and initialized to contain a range of items from an existing model. The following example constructs a selection that contains a range of items from the given model, beginning at the topLeft, and ending at the bottomRight.

QItemSelection *selection = new QItemSelection(topLeft, bottomRight);

An empty item selection can be constructed, and later populated as required. So, if the model is going to be unavailable when we construct the item selection, we can rewrite the above code in the following way:

QItemSelection *selection = new QItemSelection();

...

selection->select(topLeft, bottomRight);

QItemSelection saves memory, and avoids unnecessary work, by working with selection ranges rather than recording the model item index for each item in the selection. Generally, an instance of this class will contain a list of non-overlapping selection ranges.

Use merge() to merge one item selection into another without making overlapping ranges. Use split() to split one selection range into smaller ranges based on a another selection range.

See also Model/View Programming and QItemSelectionModel.

Constructor & Destructor Documentation

QtGui.QItemSelection.QItemSelection ( System.Type  dummy)
protected
QtGui.QItemSelection.QItemSelection ( )

Constructs an empty selection.

QtGui.QItemSelection.QItemSelection ( QItemSelection  copy)

Constructs an empty selection.

QtGui.QItemSelection.QItemSelection ( QModelIndex  topLeft,
QModelIndex  bottomRight 
)

Constructs an item selection that extends from the top-left model item, specified by the topLeft index, to the bottom-right item, specified by bottomRight.

Member Function Documentation

new bool QtGui.QItemSelection.Contains ( QModelIndex  index)

Returns true if the selection contains the given index; otherwise returns false.

virtual void QtGui.QItemSelection.CreateProxy ( )
virtual
new void QtGui.QItemSelection.Dispose ( )
new System.Collections.Generic.List<QModelIndex> QtGui.QItemSelection.Indexes ( )

Returns a list of model indexes that correspond to the selected items.

new void QtGui.QItemSelection.Merge ( QItemSelection  other,
QItemSelectionModel.SelectionFlag  command 
)

Merges the other selection with this QItemSelection using the command given. This method guarantees that no ranges are overlapping.

Note that only QItemSelectionModel::Select, QItemSelectionModel::Deselect, and QItemSelectionModel::Toggle are supported.

See also split().

new void QtGui.QItemSelection.Select ( QModelIndex  topLeft,
QModelIndex  bottomRight 
)

Adds the items in the range that extends from the top-left model item, specified by the topLeft index, to the bottom-right item, specified by bottomRight to the list.

Note: topLeft and bottomRight must have the same parent.

static void QtGui.QItemSelection.Split ( QItemSelectionRange  range,
QItemSelectionRange  other,
QItemSelection  result 
)
static

Splits the selection range using the selection other range. Removes all items in other from range and puts the result in result. This can be compared with the semantics of the subtract operation of a set.

See also merge().

Member Data Documentation

SmokeInvocation QtGui.QItemSelection.interceptor
protected

Property Documentation

virtual System.IntPtr QtGui.QItemSelection.SmokeObject
getset