Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.6.0
-
None
-
Windows 7/10
Description
If a QTableView has column 0 hidden and horizontal header moved, then selectRow function can't select entire row.
Actually, in the QTableView.cpp line 3252:
QTableView.cpp
QModelIndex tl = model->index(qMin(rowSectionAnchor, row), logicalColumn(0), root);
QModelIndex br = model->index(qMax(rowSectionAnchor, row), logicalColumn(model->columnCount(root) - 1), root);
if ((verticalHeader->sectionsMoved() && tl.row() != br.row())
|| horizontalHeader->sectionsMoved()) {
q->setSelection(q->visualRect(tl)|q->visualRect(br), command);
}
The tl and br are not considered the hidden column. So that if the column 0 is hidden, the visualRect will return empty QRect(). Then the the entire row will not selected.
Attachments
Issue Links
- duplicates
-
QTBUG-50171 QTableView can't select full row if some columns were reordered, hidden
- Closed