Qt 4.8
|
The QItemSelectionRange class manages information about a range of selected items in a model. More...
#include <qitemselectionmodel.h>
Public Functions | |
int | bottom () const |
Returns the row index corresponding to the lowermost selected row in the selection range. More... | |
QModelIndex | bottomRight () const |
Returns the index for the item located at the bottom-right corner of the selection range. More... | |
bool | contains (const QModelIndex &index) const |
Returns true if the model item specified by the index lies within the range of selected items; otherwise returns false. More... | |
bool | contains (int row, int column, const QModelIndex &parentIndex) const |
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. More... | |
int | height () const |
Returns the number of selected rows in the selection range. More... | |
QModelIndexList | indexes () const |
Returns the list of model index items stored in the selection. More... | |
QItemSelectionRange | intersect (const QItemSelectionRange &other) const |
Use intersected(other) instead. More... | |
QItemSelectionRange | intersected (const QItemSelectionRange &other) const |
Returns a new selection range containing only the items that are found in both the selection range and the other selection range. More... | |
bool | intersects (const QItemSelectionRange &other) const |
Returns true if this selection range intersects (overlaps with) the other range given; otherwise returns false. More... | |
bool | isEmpty () const |
Returns true if the selection range contains no selectable item. More... | |
bool | isValid () const |
Returns true if the selection range is valid; otherwise returns false. More... | |
int | left () const |
Returns the column index corresponding to the leftmost selected column in the selection range. More... | |
const QAbstractItemModel * | model () const |
Returns the model that the items in the selection range belong to. More... | |
bool | operator!= (const QItemSelectionRange &other) const |
Returns true if the selection range differs from the other range given; otherwise returns false. More... | |
bool | operator< (const QItemSelectionRange &other) const |
bool | operator== (const QItemSelectionRange &other) const |
Returns true if the selection range is exactly the same as the other range given; otherwise returns false. More... | |
QModelIndex | parent () const |
Returns the parent model item index of the items in the selection range. More... | |
QItemSelectionRange () | |
Constructs an empty selection range. More... | |
QItemSelectionRange (const QItemSelectionRange &other) | |
Copy constructor. More... | |
QItemSelectionRange (const QModelIndex &topLeft, const QModelIndex &bottomRight) | |
Constructs a new selection range containing only the index specified by the topLeft and the index bottomRight. More... | |
QItemSelectionRange (const QModelIndex &index) | |
Constructs a new selection range containing only the model item specified by the model index index. More... | |
int | right () const |
Returns the column index corresponding to the rightmost selected column in the selection range. More... | |
int | top () const |
Returns the row index corresponding to the uppermost selected row in the selection range. More... | |
QModelIndex | topLeft () const |
Returns the index for the item located at the top-left corner of the selection range. More... | |
int | width () const |
Returns the number of selected columns in the selection range. More... | |
Properties | |
QPersistentModelIndex | br |
QPersistentModelIndex | tl |
The QItemSelectionRange class manages information about a range of selected items in a model.
A 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 top(), left() a bottom(), right() and a parent().
The QItemSelectionRange class is one of the Model/View Classes and is part of Qt's Model/View Programming{model/view framework}.
The model items contained in the selection range can be obtained using the 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 contains() function. Ranges can also be compared using the overloaded operators for equality and inequality, and the intersects() function allows you to determine whether two ranges overlap.
Definition at line 58 of file qitemselectionmodel.h.
|
inline |
Constructs an empty selection range.
Definition at line 62 of file qitemselectionmodel.h.
Referenced by QItemSelectionModelPrivate::_q_layoutChanged(), QItemSelectionModelPrivate::_q_rowsAboutToBeRemoved(), intersect(), mergeIndexes(), QItemSelection::select(), and QItemSelection::split().
|
inline |
Copy constructor.
Constructs a new selection range with the same contents as the other range given.
Definition at line 63 of file qitemselectionmodel.h.
|
inline |
Constructs a new selection range containing only the index specified by the topLeft and the index bottomRight.
Definition at line 144 of file qitemselectionmodel.h.
|
inlineexplicit |
Constructs a new selection range containing only the model item specified by the model index index.
Definition at line 66 of file qitemselectionmodel.h.
|
inline |
Returns the row index corresponding to the lowermost selected row in the selection range.
Definition at line 71 of file qitemselectionmodel.h.
Referenced by QItemSelectionModelPrivate::_q_layoutAboutToBeChanged(), QItemSelectionModelPrivate::_q_layoutChanged(), QItemSelectionModelPrivate::_q_rowsAboutToBeInserted(), QItemSelectionModelPrivate::_q_rowsAboutToBeRemoved(), QItemSelectionModel::columnIntersectsSelection(), QItemSelectionModelPrivate::expandSelection(), indexesFromRange(), intersect(), intersects(), isEmpty(), QItemSelectionModel::rowIntersectsSelection(), QItemSelection::select(), QTableWidget::selectedRanges(), QItemSelectionModel::selectedRows(), QItemSelection::split(), QTableViewPrivate::trimHiddenSelections(), QColumnView::visualRegionForSelection(), QTableView::visualRegionForSelection(), and QHeaderView::visualRegionForSelection().
|
inline |
Returns the index for the item located at the bottom-right corner of the selection range.
Definition at line 77 of file qitemselectionmodel.h.
Referenced by intersect(), mergeIndexes(), QTreeView::moveCursor(), operator<<(), QTreeViewPrivate::select(), QListView::visualRegionForSelection(), and QTreeView::visualRegionForSelection().
|
inline |
Returns true if the model item specified by the index lies within the range of selected items; otherwise returns false.
Definition at line 81 of file qitemselectionmodel.h.
Referenced by QTableView::visualRegionForSelection().
|
inline |
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.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 88 of file qitemselectionmodel.h.
|
inline |
Returns the number of selected rows in the selection range.
Definition at line 74 of file qitemselectionmodel.h.
Referenced by QTableView::visualRegionForSelection().
QModelIndexList QItemSelectionRange::indexes | ( | ) | const |
Returns the list of model index items stored in the selection.
Definition at line 386 of file qitemselectionmodel.cpp.
Referenced by QItemSelectionModelPrivate::_q_layoutAboutToBeChanged().
QItemSelectionRange QItemSelectionRange::intersect | ( | const QItemSelectionRange & | other | ) | const |
Use intersected(other) instead.
Definition at line 294 of file qitemselectionmodel.cpp.
|
inline |
Returns a new selection range containing only the items that are found in both the selection range and the other selection range.
Definition at line 97 of file qitemselectionmodel.h.
Referenced by QItemSelectionModel::emitSelectionChanged(), and QItemSelection::merge().
bool QItemSelectionRange::intersects | ( | const QItemSelectionRange & | other | ) | const |
Returns true if this selection range intersects (overlaps with) the other range given; otherwise returns false.
Definition at line 262 of file qitemselectionmodel.cpp.
Referenced by QItemSelectionModel::emitSelectionChanged(), and QItemSelection::merge().
bool QItemSelectionRange::isEmpty | ( | ) | const |
Returns true if the selection range contains no selectable item.
Definition at line 366 of file qitemselectionmodel.cpp.
Referenced by QTableView::setSelection().
|
inline |
Returns true if the selection range is valid; otherwise returns false.
Definition at line 129 of file qitemselectionmodel.h.
Referenced by indexesFromRange(), intersects(), isEmpty(), QTreeViewPrivate::select(), QItemSelectionModel::selection(), QTableViewPrivate::trimHiddenSelections(), QTableView::visualRegionForSelection(), QListView::visualRegionForSelection(), QTreeView::visualRegionForSelection(), and QHeaderView::visualRegionForSelection().
|
inline |
Returns the column index corresponding to the leftmost selected column in the selection range.
Definition at line 70 of file qitemselectionmodel.h.
Referenced by QItemSelectionModelPrivate::_q_columnsAboutToBeInserted(), QItemSelectionModelPrivate::_q_layoutAboutToBeChanged(), QItemSelectionModel::columnIntersectsSelection(), QItemSelectionModelPrivate::expandSelection(), indexesFromRange(), intersect(), intersects(), isEmpty(), QItemSelectionModel::rowIntersectsSelection(), QTreeViewPrivate::select(), QItemSelection::select(), QItemSelectionModel::selectedColumns(), QTableWidget::selectedRanges(), QItemSelection::split(), QTableViewPrivate::trimHiddenSelections(), QTableView::visualRegionForSelection(), QTreeView::visualRegionForSelection(), and QHeaderView::visualRegionForSelection().
|
inline |
Returns the model that the items in the selection range belong to.
Definition at line 79 of file qitemselectionmodel.h.
Referenced by QItemSelectionModelPrivate::_q_columnsAboutToBeInserted(), QItemSelectionModelPrivate::_q_columnsAboutToBeRemoved(), QItemSelectionModelPrivate::_q_layoutAboutToBeChanged(), QItemSelectionModelPrivate::_q_layoutChanged(), QItemSelectionModelPrivate::_q_rowsAboutToBeInserted(), QItemSelectionModelPrivate::_q_rowsAboutToBeRemoved(), QItemSelectionModelPrivate::expandSelection(), indexesFromRange(), QItemSelectionModelPrivate::initModel(), intersect(), intersects(), isEmpty(), and QItemSelection::split().
|
inline |
Returns true if the selection range differs from the other range given; otherwise returns false.
Definition at line 102 of file qitemselectionmodel.h.
|
inline |
Definition at line 104 of file qitemselectionmodel.h.
|
inline |
Returns true if the selection range is exactly the same as the other range given; otherwise returns false.
Definition at line 100 of file qitemselectionmodel.h.
|
inline |
Returns the parent model item index of the items in the selection range.
Definition at line 78 of file qitemselectionmodel.h.
Referenced by QItemSelectionModelPrivate::_q_columnsAboutToBeRemoved(), QItemSelectionModelPrivate::_q_layoutAboutToBeChanged(), QItemSelectionModelPrivate::_q_rowsAboutToBeRemoved(), QItemSelectionModelPrivate::expandSelection(), indexesFromRange(), intersect(), intersects(), isEmpty(), QTreeViewPrivate::select(), QItemSelectionModel::selectedColumns(), QItemSelectionModel::selectedRows(), QItemSelection::split(), QTableViewPrivate::trimHiddenSelections(), QTableView::visualRegionForSelection(), QTreeView::visualRegionForSelection(), and QHeaderView::visualRegionForSelection().
|
inline |
Returns the column index corresponding to the rightmost selected column in the selection range.
Definition at line 72 of file qitemselectionmodel.h.
Referenced by QItemSelectionModelPrivate::_q_columnsAboutToBeInserted(), QItemSelectionModelPrivate::_q_layoutAboutToBeChanged(), QItemSelectionModelPrivate::_q_layoutChanged(), QItemSelectionModel::columnIntersectsSelection(), QItemSelectionModelPrivate::expandSelection(), indexesFromRange(), intersect(), intersects(), isEmpty(), QItemSelectionModel::rowIntersectsSelection(), QItemSelection::select(), QItemSelectionModel::selectedColumns(), QTableWidget::selectedRanges(), QItemSelection::split(), QTableViewPrivate::trimHiddenSelections(), QTableView::visualRegionForSelection(), QTreeView::visualRegionForSelection(), and QHeaderView::visualRegionForSelection().
|
inline |
Returns the row index corresponding to the uppermost selected row in the selection range.
Definition at line 69 of file qitemselectionmodel.h.
Referenced by QItemSelectionModelPrivate::_q_layoutAboutToBeChanged(), QItemSelectionModelPrivate::_q_rowsAboutToBeInserted(), QItemSelectionModelPrivate::_q_rowsAboutToBeRemoved(), QItemSelectionModel::columnIntersectsSelection(), QItemSelectionModelPrivate::expandSelection(), indexesFromRange(), intersect(), intersects(), isEmpty(), QItemSelectionModel::rowIntersectsSelection(), QTreeViewPrivate::select(), QItemSelection::select(), QTableWidget::selectedRanges(), QItemSelectionModel::selectedRows(), QItemSelection::split(), QTableViewPrivate::trimHiddenSelections(), QColumnView::visualRegionForSelection(), QTableView::visualRegionForSelection(), and QHeaderView::visualRegionForSelection().
|
inline |
Returns the index for the item located at the top-left corner of the selection range.
Definition at line 76 of file qitemselectionmodel.h.
Referenced by intersect(), mergeIndexes(), QTreeView::moveCursor(), operator<<(), QListView::visualRegionForSelection(), and QTreeView::visualRegionForSelection().
|
inline |
Returns the number of selected columns in the selection range.
Definition at line 73 of file qitemselectionmodel.h.
Referenced by QTableView::visualRegionForSelection().
|
private |
Definition at line 140 of file qitemselectionmodel.h.
Referenced by QItemSelectionModelPrivate::_q_columnsAboutToBeRemoved(), QItemSelectionModelPrivate::_q_layoutChanged(), QItemSelectionModelPrivate::expandSelection(), mergeIndexes(), operator<(), operator==(), QItemSelection::select(), and QItemSelection::split().
|
private |
Definition at line 140 of file qitemselectionmodel.h.
Referenced by QItemSelectionModelPrivate::_q_columnsAboutToBeRemoved(), QItemSelectionModelPrivate::_q_layoutChanged(), QItemSelectionModelPrivate::expandSelection(), mergeIndexes(), operator<(), operator==(), QItemSelection::select(), and QItemSelection::split().