Table Of Contents

Previous topic

QItemSelection

Next topic

QUndoCommand

QItemSelectionRange

Inheritance diagram of QItemSelectionRange

Synopsis

Functions

Detailed Description

The PySide.QtGui.QItemSelectionRange class manages information about a range of selected items in a model.

A PySide.QtGui.QItemSelectionRange contains information about a range of selected items in a model. A range of items is a contiguous array of model items, extending to cover a number of adjacent rows and columns with a common parent item; this can be visualized as a two-dimensional block of cells in a table. A selection range has a PySide.QtGui.QItemSelectionRange.top() , PySide.QtGui.QItemSelectionRange.left() a PySide.QtGui.QItemSelectionRange.bottom() , PySide.QtGui.QItemSelectionRange.right() and a PySide.QtGui.QItemSelectionRange.parent() .

The PySide.QtGui.QItemSelectionRange class is one of the Model/View Classes and is part of Qt’s model/view framework .

The model items contained in the selection range can be obtained using the PySide.QtGui.QItemSelectionRange.indexes() function. Use QItemSelectionModel.selectedIndexes() to get a list of all selected items for a view.

You can determine whether a given model item lies within a particular range by using the PySide.QtGui.QItemSelectionRange.contains() function. Ranges can also be compared using the overloaded operators for equality and inequality, and the PySide.QtGui.QItemSelectionRange.intersects() function allows you to determine whether two ranges overlap.

class PySide.QtGui.QItemSelectionRange
class PySide.QtGui.QItemSelectionRange(other)
class PySide.QtGui.QItemSelectionRange(index)
class PySide.QtGui.QItemSelectionRange(topLeft, bottomRight)
Parameters:

Constructs an empty selection range.

Copy constructor. Constructs a new selection range with the same contents as the other range given.

Constructs a new selection range containing only the model item specified by the model index index .

Constructs a new selection range containing only the index specified by the topLeft and the index bottomRight .

PySide.QtGui.QItemSelectionRange.bottom()
Return type:PySide.QtCore.int

Returns the row index corresponding to the lowermost selected row in the selection range.

PySide.QtGui.QItemSelectionRange.bottomRight()
Return type:PySide.QtCore.QModelIndex

Returns the index for the item located at the bottom-right corner of the selection range.

PySide.QtGui.QItemSelectionRange.contains(row, column, parentIndex)
Parameters:
Return type:

PySide.QtCore.bool

This is an overloaded function.

Returns true if the model item specified by (row , column ) and with parentIndex as the parent item lies within the range of selected items; otherwise returns false.

PySide.QtGui.QItemSelectionRange.contains(index)
Parameters:indexPySide.QtCore.QModelIndex
Return type:PySide.QtCore.bool

Returns true if the model item specified by the index lies within the range of selected items; otherwise returns false.

PySide.QtGui.QItemSelectionRange.height()
Return type:PySide.QtCore.int

Returns the number of selected rows in the selection range.

PySide.QtGui.QItemSelectionRange.indexes()
Return type:

Returns the list of model index items stored in the selection.

PySide.QtGui.QItemSelectionRange.intersected(other)
Parameters:otherPySide.QtGui.QItemSelectionRange
Return type:PySide.QtGui.QItemSelectionRange

Returns a new selection range containing only the items that are found in both the selection range and the other selection range.

PySide.QtGui.QItemSelectionRange.intersects(other)
Parameters:otherPySide.QtGui.QItemSelectionRange
Return type:PySide.QtCore.bool

Returns true if this selection range intersects (overlaps with) the other range given; otherwise returns false.

PySide.QtGui.QItemSelectionRange.isEmpty()
Return type:PySide.QtCore.bool

Returns true if the selection range contains no selectable item

PySide.QtGui.QItemSelectionRange.isValid()
Return type:PySide.QtCore.bool

Returns true if the selection range is valid; otherwise returns false.

PySide.QtGui.QItemSelectionRange.left()
Return type:PySide.QtCore.int

Returns the column index corresponding to the leftmost selected column in the selection range.

PySide.QtGui.QItemSelectionRange.model()
Return type:PySide.QtCore.QAbstractItemModel

Returns the model that the items in the selection range belong to.

PySide.QtGui.QItemSelectionRange.__ne__(other)
Parameters:otherPySide.QtGui.QItemSelectionRange
Return type:PySide.QtCore.bool

Returns true if the selection range differs from the other range given; otherwise returns false.

PySide.QtGui.QItemSelectionRange.__eq__(other)
Parameters:otherPySide.QtGui.QItemSelectionRange
Return type:PySide.QtCore.bool

Returns true if the selection range is exactly the same as the other range given; otherwise returns false.

PySide.QtGui.QItemSelectionRange.parent()
Return type:PySide.QtCore.QModelIndex

Returns the parent model item index of the items in the selection range.

PySide.QtGui.QItemSelectionRange.right()
Return type:PySide.QtCore.int

Returns the column index corresponding to the rightmost selected column in the selection range.

PySide.QtGui.QItemSelectionRange.top()
Return type:PySide.QtCore.int

Returns the row index corresponding to the uppermost selected row in the selection range.

PySide.QtGui.QItemSelectionRange.topLeft()
Return type:PySide.QtCore.QModelIndex

Returns the index for the item located at the top-left corner of the selection range.

PySide.QtGui.QItemSelectionRange.width()
Return type:PySide.QtCore.int

Returns the number of selected columns in the selection range.