mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
Select elements correctly when clicking on the category for selecting.
svn path=/trunk/KDE/kdebase/apps/; revision=687361
This commit is contained in:
parent
292e732ff9
commit
5c5590846d
1 changed files with 5 additions and 5 deletions
|
@ -691,7 +691,7 @@ void KCategorizedView::resizeEvent(QResizeEvent *event)
|
||||||
}
|
}
|
||||||
|
|
||||||
void KCategorizedView::setSelection(const QRect &rect,
|
void KCategorizedView::setSelection(const QRect &rect,
|
||||||
QItemSelectionModel::SelectionFlags flags)
|
QItemSelectionModel::SelectionFlags flags)
|
||||||
{
|
{
|
||||||
if ((viewMode() != KCategorizedView::IconMode) || !d->proxyModel ||
|
if ((viewMode() != KCategorizedView::IconMode) || !d->proxyModel ||
|
||||||
!d->itemCategorizer)
|
!d->itemCategorizer)
|
||||||
|
@ -865,10 +865,10 @@ void KCategorizedView::mouseReleaseEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (d->categoryVisualRect(category).contains(event->pos()))
|
if (d->categoryVisualRect(category).contains(event->pos()))
|
||||||
{
|
{
|
||||||
QItemSelectionRange selectionRange(d->proxyModel->mapFromSource(d->categoriesIndexes[category][0]),
|
foreach (const QModelIndex &index, d->categoriesIndexes[category])
|
||||||
d->proxyModel->mapFromSource(d->categoriesIndexes[category][d->categoriesIndexes[category].count() - 1]));
|
{
|
||||||
|
selection << QItemSelectionRange(d->proxyModel->mapFromSource(index));
|
||||||
selection << selectionRange;
|
}
|
||||||
|
|
||||||
selectionModel()->select(selection, QItemSelectionModel::Select);
|
selectionModel()->select(selection, QItemSelectionModel::Select);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue