, isDragging(false)
, dragLeftViewport(false)
, proxyModel(0)
- , lastIndex(QModelIndex())
{
}
void KCategorizedView::Private::updateScrollbars()
{
+ // find the last index in the last category
+ QModelIndex lastIndex = categoriesIndexes.isEmpty() ? QModelIndex() : categoriesIndexes[categories.last()].last();
+
int lastItemBottom = cachedRectIndex(lastIndex).top() +
listView->spacing() + (listView->gridSize().isEmpty() ? 0 : listView->gridSize().height()) - listView->viewport()->height();
QStyleOptionViewItemV3 option = viewOptions();
option.widget = this;
+ if (wordWrap())
+ {
+ option.features |= QStyleOptionViewItemV2::WrapText;
+ }
+
QPainter painter(viewport());
QRect area = event->rect();
const bool focus = (hasFocus() || viewport()->hasFocus()) &&
foreach (const QModelIndex &index, dirtyIndexes)
{
option.state = state;
- option.rect = d->visualRect(index);
+ option.rect = visualRect(index);
if (selectionModel() && selectionModel()->isSelected(index))
{
d->lastSelection = selectionModel()->selection();
if (d->hovered.isValid())
- viewport()->update(d->visualRect(d->hovered));
+ viewport()->update(visualRect(d->hovered));
else if (!d->hoveredCategory.isEmpty())
viewport()->update(d->categoryVisualRect(d->hoveredCategory));
}
qStableSort(indexList.begin(), indexList.end(), categoryLessThan);
}
- d->lastIndex = d->categoriesIndexes[d->categories[d->categories.count() - 1]][d->categoriesIndexes[d->categories[d->categories.count() - 1]].count() - 1];
-
// Finally, fill data information of items situation. This will help when
// trying to compute an item place in the viewport
int i = 0; // position relative to the category beginning