svn path=/trunk/KDE/kdebase/apps/; revision=875518
// Choose a sensible startIndex - a parentless index in the
// name column, as close to the top of the rect as we
// can find.
// Choose a sensible startIndex - a parentless index in the
// name column, as close to the top of the rect as we
// can find.
- QRect normalisedRect = rect.normalized();
- QModelIndex startIndex = QTreeView::indexAt(normalisedRect.topLeft());
+ const QRect normalizedRect = rect.normalized();
+ QModelIndex startIndex = QTreeView::indexAt(normalizedRect.topLeft());
if (startIndex.isValid()) {
while (startIndex.parent().isValid()) {
startIndex = startIndex.parent();
if (startIndex.isValid()) {
while (startIndex.parent().isValid()) {
startIndex = startIndex.parent();
}
startIndex = model()->index(startIndex.row(), KDirModel::Name);
clearSelection();
}
startIndex = model()->index(startIndex.row(), KDirModel::Name);
clearSelection();
- setSelectionRecursive(startIndex, normalisedRect, command);
+ setSelectionRecursive(startIndex, normalizedRect, command);
+ QItemSelection selection;
// rect is assumed to be in viewport coordinates and normalized.
// Move down through the siblings of startIndex, exploring the children
// of any expanded nodes.
// rect is assumed to be in viewport coordinates and normalized.
// Move down through the siblings of startIndex, exploring the children
// of any expanded nodes.
- QRect itemContentRect = nameColumnRect(currIndex);
+ const QRect itemContentRect = nameColumnRect(currIndex);
if (itemContentRect.top() > rect.bottom()) {
// All remaining items will be below itemContentRect, so we may cull.
if (itemContentRect.top() > rect.bottom()) {
// All remaining items will be below itemContentRect, so we may cull.
}
if (itemContentRect.intersects(rect)) {
}
if (itemContentRect.intersects(rect)) {
- selectionModel()->select(currIndex, QItemSelectionModel::Select);
+ selection.select(currIndex, currIndex);
}
currIndex = belowIndex;
} while (currIndex.isValid());
}
currIndex = belowIndex;
} while (currIndex.isValid());
+ selectionModel()->select(selection, QItemSelectionModel::Select);
}
#include "dolphindetailsview.moc"
}
#include "dolphindetailsview.moc"