Hi,

Found the interesting behavior when using QListView with viewport margins
and right-to-left languages. ( Qt 5.6.2)
When the direction is rigth-to-left the rectangle is not correct and there
is some suspicious code in QAbstractScrollAreaPrivate::layoutChildren()


 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


Can anybody explain why viewportRect adjusted depending on isRightToLeft?
The logic with adjusting is just to replace right margin to left and
opposite - in that case, QStyle::visualRect will do all job.

In my case I fixed my problem just remove the case with checking isRightToLeft,
as below:

viewportRect.adjust(left, top, -right, -bottom);
viewport->setGeometry(QStyle::visualRect(opt.direction, opt.rect,
viewportRect)); // resize the viewport last

Please advice.

-- 

Regards,

Pavlo Shyba


Mobile: +38-096-8760851  Skype:  shyba.pavlo
www.globallogic.com
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to