Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.6.2
-
None
Description
When using QListView with non-zero viewport margins and IconMode - the translated viewport rectangle is incorrect in a case when right-to-left direction.
For example, execution setViewportMargins(50, 0, 0, 0); should provide left shifting when left-to-right direction. The margin should be from right side when righ-to-left direction. But it not. Is it correct behavior?
The suspicious code in QAbstractScrollAreaPrivate::layoutChildren() :
src/widgets/widgets/qabstractscrollarea.cpp
if (q->isRightToLeft()) viewportRect.adjust(right, top, -left, -bottom); else viewportRect.adjust(left, top, -right, -bottom); viewport->setGeometry(QStyle::visualRect(opt.direction, opt.rect, viewportRect)); // resize the viewport last
There is unnecessary isRightToLeft checking and adjust operation.