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

Scaled combobox popup has an incorrect position when flipped

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.8.3
    • Quick: Controls 2
    • None
    • macOS

    Description

      If we scale a combobox and its popup accordingly, its popup has an incorrect position when it is flipped vertically to stay inside our window

       

      The following example displays two scaled comboboxes (x2):

      • the popup of the top one has a correct position (no vertical flip)
      • the popup of the bottom one has an incorrect position (vertical flip)

       

      This issue comes from the calculations in QQuickPopupPositioner::reposition() when it tries to flip the popup around (above <-> below) to fit vertically inside the window

       

      newTopLeft is defined as const QPointF newTopLeft(p->x, m_parentItem->height() - p->y - rect.height());

      It should take into account the scale factor between m_parentItem and popupItem->parentItem() to subtract rect.height() e.g.

      ~~~

      const auto scaleFactor = m_parentItem->mapToItem(popupItem->parentItem(), QRectF{0, 0, 1, 1}).height();
      const QPointF newTopLeft(p->x, m_parentItem->height() - p->y - rect.height()/scaleFactor);
      ~~~

       

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            lemortalexandre Alexandre Lemort
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes