if (listView->layoutDirection() == Qt::LeftToRight)
{
retRect = QRect(listView->spacing(), listView->spacing() * 2 +
- categoryDrawer->categoryHeight(listView->viewOptions()), 0, 0);
+ categoryDrawer->categoryHeight(index, listView->viewOptions()), 0, 0);
}
else
{
retRect = QRect(listView->viewport()->width() - listView->spacing(), listView->spacing() * 2 +
- categoryDrawer->categoryHeight(listView->viewOptions()), 0, 0);
+ categoryDrawer->categoryHeight(index, listView->viewOptions()), 0, 0);
}
int viewportWidth = listView->viewport()->width() - listView->spacing();
retRect.setTop(retRect.top() +
(rowsInt * itemHeight) +
- categoryDrawer->categoryHeight(listView->viewOptions()) +
+ categoryDrawer->categoryHeight(index, listView->viewOptions()) +
listView->spacing() * 2);
if (listView->gridSize().isEmpty())
retRect.setTop(retRect.top() +
(rowsInt * itemHeight) +
- categoryDrawer->categoryHeight(listView->viewOptions()) +
+ categoryDrawer->categoryHeight(index, listView->viewOptions()) +
listView->spacing() * 2);
if (listView->gridSize().isEmpty())
}
}
- retRect.setHeight(categoryDrawer->categoryHeight(listView->viewOptions()));
+ retRect.setHeight(categoryDrawer->categoryHeight(index, listView->viewOptions()));
return retRect;
}
QModelIndex lastIndex = categoriesIndexes.isEmpty() ? QModelIndex() : categoriesIndexes[categories.last()].last();
int lastItemBottom = cachedRectIndex(lastIndex).top() +
- listView->spacing() + (listView->gridSize().isEmpty() ? cachedRectIndex(lastIndex).height() : listView->gridSize().height()) - listView->viewport()->height();
+ listView->spacing() + (listView->gridSize().isEmpty() ? biggestItemSize.height() : listView->gridSize().height()) - listView->viewport()->height();
listView->horizontalScrollBar()->setRange(0, 0);
{
if (d->categoryVisualRect(category).contains(event->pos()))
{
- QItemSelection selection;
+ QItemSelection selection = selectionModel()->selection();
QModelIndexList indexList = d->categoriesIndexes[category];
foreach (const QModelIndex &index, indexList)
selection << QItemSelectionRange(selectIndex);
}
- selectionModel()->select(selection, QItemSelectionModel::Select);
+ selectionModel()->select(selection, QItemSelectionModel::SelectCurrent);
break;
}