} else {
pos.rx() -= m_itemMargin.width();
pos.ry() = 0;
-
+
// Determine the maximum width used in the
// current column. As the scroll-direction is
// Qt::Horizontal and m_itemRects is accessed directly,
if (bounds.y() != y) {
break;
}
-
+
if (bounds.height() > width) {
width = bounds.height();
}
-
- ++index;
+
+ ++index;
}
-
+
size = QSizeF(width, m_size.height());
}
return QRectF(pos, size);
return (m_scrollOrientation == Qt::Vertical)
? m_itemInfos[index].column
- : m_itemInfos[index].row;
+ : m_itemInfos[index].row;
}
int KItemListViewLayouter::itemRow(int index) const
return (m_scrollOrientation == Qt::Vertical)
? m_itemInfos[index].row
- : m_itemInfos[index].column;
+ : m_itemInfos[index].column;
}
int KItemListViewLayouter::maximumVisibleItems() const
QSizeF itemSize = m_itemSize;
QSizeF itemMargin = m_itemMargin;
QSizeF size = m_size;
-
+
const bool grouped = createGroupHeaders();
const bool horizontalScrolling = (m_scrollOrientation == Qt::Horizontal);
itemMargin.setHeight(m_itemMargin.width());
size.setWidth(m_size.height());
size.setHeight(m_size.width());
-
+
if (grouped) {
// In the horizontal scrolling case all groups are aligned
// at the top, which decreases the available height. For the
m_itemInfos.erase(m_itemInfos.begin() + itemCount,
m_itemInfos.end());
}
-
+
if (itemCount > 0) {
// Calculate the maximum y-range of the last row for m_maximumScrollOffset
m_maximumScrollOffset = m_itemInfos.last().rect.bottom();