Don't let the item be invisible if the header is shown.
void KItemListView::scrollToItem(int index)
{
void KItemListView::scrollToItem(int index)
{
- const QRectF viewGeometry = geometry();
+ QRectF viewGeometry = geometry();
+ if (m_header) {
+ const qreal headerHeight = m_header->size().height();
+ viewGeometry.adjust(0, headerHeight, 0, 0);
+ }
const QRectF currentRect = itemRect(index);
if (!viewGeometry.contains(currentRect)) {
const QRectF currentRect = itemRect(index);
if (!viewGeometry.contains(currentRect)) {