#include "qitemselectionmodel.h"
#include <private/qitemselectionmodel_p.h>
#include <qdebug.h>
#include "moc_qitemselectionmodel.cpp"
Go to the source code of this file.
◆ indexesFromRange()
Definition at line 347 of file qitemselectionmodel.cpp.
Referenced by QItemSelectionRange::indexes(), and QItemSelection::indexes().
350 for (
int column = range.
left(); column <= range.
right(); ++column) {
351 for (
int row = range.
top(); row <= range.
bottom(); ++row) {
353 Qt::ItemFlags flags = range.
model()->
flags(index);
int left() const
Returns the column index corresponding to the leftmost selected column in the selection range...
bool isValid() const
Returns true if the selection range is valid; otherwise returns false.
int bottom() const
Returns the row index corresponding to the lowermost selected row in the selection range...
int right() const
Returns the column index corresponding to the rightmost selected column in the selection range...
QModelIndex parent() const
Returns the parent model item index of the items in the selection range.
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Returns the item flags for the given index.
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const =0
Returns the index of the item in the model specified by the given row, column and parent index...
void append(const T &t)
Inserts value at the end of the list.
The QModelIndex class is used to locate data in a data model.
int top() const
Returns the row index corresponding to the uppermost selected row in the selection range...
const QAbstractItemModel * model() const
Returns the model that the items in the selection range belong to.
◆ mergeIndexes()
Merges indexes into an item selection made up of ranges.
- Warning
- This function is not part of the public interface.
Assumes that the indexes are sorted.
Definition at line 902 of file qitemselectionmodel.cpp.
Referenced by QItemSelectionModelPrivate::_q_layoutChanged().
907 while (i < indexes.
count()) {
910 while (++i < indexes.
count()) {
913 && (next.
row() == br.
row())
924 while (i < colSpans.
count()) {
928 while (++i < colSpans.
count()) {
936 && (nextTl.
row() == prevTl.
row() + 1) && (nextBr.
row() == br.
row() + 1)) {
QModelIndex bottomRight() const
Returns the index for the item located at the bottom-right corner of the selection range...
The QItemSelectionRange class manages information about a range of selected items in a model...
int count(const T &t) const
Returns the number of occurrences of value in the list.
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
QModelIndex topLeft() const
Returns the index for the item located at the top-left corner of the selection range.
void append(const T &t)
Inserts value at the end of the list.
int row() const
Returns the row this model index refers to.
const T & at(int i) const
Returns the item at index position i in the list.
The QItemSelection class manages information about selected items in a model.
The QModelIndex class is used to locate data in a data model.
int column() const
Returns the column this model index refers to.
◆ operator<<()
Definition at line 1721 of file qitemselectionmodel.cpp.
1723 #ifndef Q_BROKEN_DEBUG_STREAM 1728 qWarning(
"This compiler doesn't support streaming QItemSelectionRange to QDebug");
QModelIndex bottomRight() const
Returns the index for the item located at the bottom-right corner of the selection range...
QDebug & nospace()
Clears the stream's internal flag that records whether the last character was a space and returns a r...
QModelIndex topLeft() const
Returns the index for the item located at the top-left corner of the selection range.
Q_CORE_EXPORT void qWarning(const char *,...)
QDebug & space()
Writes a space character to the debug stream and returns a reference to the stream.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...