Fix indentation in QTableView's selection handling code
Makes the follow up patch clean to review. Pick-to: 6.7 6.5 Task-number: QTBUG-119076 Change-Id: I38c2b02876af93ce668ade7bce97b32a9ec2cef0 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 71d0ea7d042d61e8d42e9cf2700c439d4337345b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
e3b0d2f93c
commit
208ad426b4
@ -2054,21 +2054,21 @@ void QTableView::setSelection(const QRect &rect, QItemSelectionModel::SelectionF
|
||||
break;
|
||||
}
|
||||
} while (expanded);
|
||||
if (intersectsSpan) {
|
||||
selection.reserve((right - left + 1) * (bottom - top + 1));
|
||||
for (int horizontal = left; horizontal <= right; ++horizontal) {
|
||||
int column = d->logicalColumn(horizontal);
|
||||
for (int vertical = top; vertical <= bottom; ++vertical) {
|
||||
int row = d->logicalRow(vertical);
|
||||
QModelIndex index = d->model->index(row, column, d->root);
|
||||
selection.append(QItemSelectionRange(index));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
QItemSelectionRange range(tl, br);
|
||||
if (!range.isEmpty())
|
||||
selection.append(range);
|
||||
}
|
||||
if (intersectsSpan) {
|
||||
selection.reserve((right - left + 1) * (bottom - top + 1));
|
||||
for (int horizontal = left; horizontal <= right; ++horizontal) {
|
||||
int column = d->logicalColumn(horizontal);
|
||||
for (int vertical = top; vertical <= bottom; ++vertical) {
|
||||
int row = d->logicalRow(vertical);
|
||||
QModelIndex index = d->model->index(row, column, d->root);
|
||||
selection.append(QItemSelectionRange(index));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
QItemSelectionRange range(tl, br);
|
||||
if (!range.isEmpty())
|
||||
selection.append(range);
|
||||
}
|
||||
} else if (verticalMoved && horizontalMoved) {
|
||||
int top = d->visualRow(tl.row());
|
||||
int left = d->visualColumn(tl.column());
|
||||
|
Loading…
x
Reference in New Issue
Block a user