Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-64866

QListView have incorrect viewport rectangle when there is right to left language

    XMLWordPrintable

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.

      Attachments

        For Gerrit Dashboard: QTBUG-64866
        # Subject Branch Project Status CR V

        Activity

          People

            richard Richard Moe Gustavsen
            pavloshyba Pavlo Shyba
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes