Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

QItemSelectionRange Class

TheQItemSelectionRange class manages information about a range of selected items in a model.More...

Header:#include <QItemSelectionRange>

Public Functions

QItemSelectionRange()
QItemSelectionRange(const QItemSelectionRange & other)
QItemSelectionRange(const QModelIndex & topLeft, const QModelIndex & bottomRight)
QItemSelectionRange(const QModelIndex & index)
intbottom() const
QModelIndexbottomRight() const
boolcontains(const QModelIndex & index) const
boolcontains(int row, int column, const QModelIndex & parentIndex) const
intheight() const
QModelIndexListindexes() const
QItemSelectionRangeintersected(const QItemSelectionRange & other) const
boolintersects(const QItemSelectionRange & other) const
boolisEmpty() const
boolisValid() const
intleft() const
const QAbstractItemModel *model() const
QModelIndexparent() const
intright() const
inttop() const
QModelIndextopLeft() const
intwidth() const
booloperator!=(const QItemSelectionRange & other) const
booloperator<(const QItemSelectionRange & other) const
booloperator==(const QItemSelectionRange & other) const

Detailed Description

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.

Member Function Documentation

QItemSelectionRange::QItemSelectionRange()

Constructs an empty selection range.

QItemSelectionRange::QItemSelectionRange(constQItemSelectionRange & other)

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

QItemSelectionRange::QItemSelectionRange(constQModelIndex & topLeft, constQModelIndex & bottomRight)

Constructs a new selection range containing only the index specified by thetopLeft and the indexbottomRight.

QItemSelectionRange::QItemSelectionRange(constQModelIndex & index)

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

int QItemSelectionRange::bottom() const

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

QModelIndex QItemSelectionRange::bottomRight() const

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

See alsobottom(),right(), andtopLeft().

bool QItemSelectionRange::contains(constQModelIndex & index) const

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

bool QItemSelectionRange::contains(int row,int column, constQModelIndex & parentIndex) const

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.

int QItemSelectionRange::height() const

Returns the number of selected rows in the selection range.

QModelIndexList QItemSelectionRange::indexes() const

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

QItemSelectionRange QItemSelectionRange::intersected(constQItemSelectionRange & other) const

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.

bool QItemSelectionRange::intersects(constQItemSelectionRange & other) const

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

bool QItemSelectionRange::isEmpty() const

Returns true if the selection range contains no selectable item

This function was introduced in Qt 4.7.

bool QItemSelectionRange::isValid() const

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

int QItemSelectionRange::left() const

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

constQAbstractItemModel * QItemSelectionRange::model() const

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

QModelIndex QItemSelectionRange::parent() const

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

int QItemSelectionRange::right() const

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

int QItemSelectionRange::top() const

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

QModelIndex QItemSelectionRange::topLeft() const

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

See alsotop(),left(), andbottomRight().

int QItemSelectionRange::width() const

Returns the number of selected columns in the selection range.

bool QItemSelectionRange::operator!=(constQItemSelectionRange & other) const

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

bool QItemSelectionRange::operator<(constQItemSelectionRange & other) const

bool QItemSelectionRange::operator==(constQItemSelectionRange & other) const

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.


[8]ページ先頭

©2009-2025 Movatter.jp