
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
TheQItemSelectionRange class manages information about a range of selected items in a model.More...
| Header: | #include <QItemSelectionRange> |
| QItemSelectionRange() | |
| QItemSelectionRange(const QItemSelectionRange & other) | |
| QItemSelectionRange(const QModelIndex & topLeft, const QModelIndex & bottomRight) | |
| QItemSelectionRange(const QModelIndex & index) | |
| int | bottom() const |
| QModelIndex | bottomRight() const |
| bool | contains(const QModelIndex & index) const |
| bool | contains(int row, int column, const QModelIndex & parentIndex) const |
| int | height() const |
| QModelIndexList | indexes() const |
| QItemSelectionRange | intersected(const QItemSelectionRange & other) const |
| bool | intersects(const QItemSelectionRange & other) const |
| bool | isEmpty() const |
| bool | isValid() const |
| int | left() const |
| const QAbstractItemModel * | model() const |
| QModelIndex | parent() const |
| int | right() const |
| int | top() const |
| QModelIndex | topLeft() const |
| int | width() const |
| bool | operator!=(const QItemSelectionRange & other) const |
| bool | operator<(const QItemSelectionRange & other) const |
| bool | operator==(const QItemSelectionRange & other) const |
TheQItemSelectionRange class manages information about a range of selected items in a model.
AQItemSelectionRange 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 atop(),left() abottom(),right() and aparent().
TheQItemSelectionRange class is one of theModel/View Classes and is part of Qt'smodel/view framework.
The model items contained in the selection range can be obtained using theindexes() function. UseQItemSelectionModel::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 thecontains() function. Ranges can also be compared using the overloaded operators for equality and inequality, and theintersects() function allows you to determine whether two ranges overlap.
See alsoModel/View Programming,QAbstractItemModel,QItemSelection, andQItemSelectionModel.
Constructs an empty selection range.
Copy constructor. Constructs a new selection range with the same contents as theother range given.
Constructs a new selection range containing only the index specified by thetopLeft and the indexbottomRight.
Constructs a new selection range containing only the model item specified by the model indexindex.
Returns the row index corresponding to the lowermost selected row in the selection range.
Returns the index for the item located at the bottom-right corner of the selection range.
See alsobottom(),right(), andtopLeft().
Returns true if the model item specified by theindex lies within the range of selected items; otherwise returns false.
This is an overloaded function.
Returns true if the model item specified by (row,column) and withparentIndex as the parent item lies within the range of selected items; otherwise returns false.
Returns the number of selected rows in the selection range.
Returns the list of model index items stored in the selection.
Returns a new selection range containing only the items that are found in both the selection range and theother selection range.
This function was introduced in Qt 4.2.
Returns true if this selection range intersects (overlaps with) theother range given; otherwise returns false.
Returns true if the selection range contains no selectable item
This function was introduced in Qt 4.7.
Returns true if the selection range is valid; otherwise returns false.
Returns the column index corresponding to the leftmost selected column in the selection range.
Returns the model that the items in the selection range belong to.
Returns the parent model item index of the items in the selection range.
Returns the column index corresponding to the rightmost selected column in the selection range.
Returns the row index corresponding to the uppermost selected row in the selection range.
Returns the index for the item located at the top-left corner of the selection range.
See alsotop(),left(), andbottomRight().
Returns the number of selected columns in the selection range.
Returns true if the selection range differs from theother range given; otherwise returns false.
Returns true if the selection range is exactly the same as theother range given; otherwise returns false.
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.