const int y = (m_scrollOrientation == Qt::Vertical) ? padding : horizontalMargin;
- m_roleBounds = QRectF(horizontalMargin + padding, y, size().width() - 2 * padding - horizontalMargin, roleHeight);
+ m_roleBounds = QRectF(horizontalMargin + padding, y, size().width() - 2 * (padding + horizontalMargin), roleHeight);
update();
}
QRectF currentRect = itemRect(index);
if (layoutDirection() == Qt::RightToLeft && scrollOrientation() == Qt::Horizontal) {
- currentRect.moveTo(m_layouter->size().width() - currentRect.right(), 0);
+ currentRect.moveLeft(m_layouter->size().width() - currentRect.right());
}
// Fix for Bug 311099 - View the underscore when using Ctrl + PageDown
painter->setPen(color);
if (scrollOrientation() == Qt::Horizontal) {
- painter->drawLine(0, 0, 0, size().height() - 1);
+ const qreal x = layoutDirection() == Qt::RightToLeft ? size().width() - 1 : 0;
+ painter->drawLine(x, 0, x, size().height() - 1);
} else {
if (layoutDirection() == Qt::LeftToRight) {
painter->drawLine(0, 0, size().width() - 1, 0);
QPointF pos(y, x);
sizeHint.transpose();
if (QGuiApplication::isRightToLeft()) {
- pos.rx() = m_size.width() + m_scrollOffset - pos.x() - sizeHint.width();
+ pos.rx() = m_size.width() - 1 + m_scrollOffset - pos.x() - sizeHint.width();
} else {
pos.rx() -= m_scrollOffset;
}
pos.ry() -= m_groupHeaderHeight;
size = QSizeF(m_size.width(), m_groupHeaderHeight);
} else {
- pos.rx() -= m_itemMargin.width();
pos.ry() = 0;
// Determine the maximum width used in the current column. As the
}
size = QSizeF(headerWidth, m_size.height());
+
+ if (QGuiApplication::isRightToLeft()) {
+ pos.setX(firstItemRect.right() + m_itemMargin.width() - size.width());
+ } else {
+ pos.rx() -= m_itemMargin.width();
+ }
}
+
return QRectF(pos, size);
}
// Calculate the offset of each column, i.e., the x-coordinate where the column starts.
m_columnOffsets.resize(m_columnCount);
- qreal currentOffset = isRightToLeft ? widthForColumns : m_xPosInc;
+ qreal currentOffset = isRightToLeft && !horizontalScrolling ? widthForColumns : m_xPosInc;
if (grouped && horizontalScrolling) {
// All group headers will always be aligned on the top and not
if (isRightToLeft) {
for (int column = 0; column < m_columnCount; ++column) {
if (horizontalScrolling) {
- m_columnOffsets[column] = column * m_columnWidth;
+ m_columnOffsets[column] = currentOffset + column * m_columnWidth;
} else {
currentOffset -= m_columnWidth;
m_columnOffsets[column] = currentOffset;