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

QQuickPopupPositioner uses wrong bounds when Window.contentOrientation == Screen.orientation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.7.1, 6.8.0 FF
    • 6.7.0 Beta3
    • Quick: Controls 2
    • None
    • 7169e3f1f (dev), b8c8a438c (6.7)

    Description

      Code

      import QtQuick
      import QtQuick.Controls.Basic
      
      Window {
          width: 640
          height: 480
          visible: true
          contentOrientation: orientationButton.checked? Screen.orientation : Qt.PrimaryOrientation
      
          Button {
              id: orientationButton
              text: checked ? "LandscapeOrientation" : "PrimaryOrientation"
              checkable: true
          }
      
          ComboBox {
              y: parent.height/2
              model: ["Alpha", "Bravo", "Charlie"]
          }
      }
      

       

      Expected outcomes (contentOrientation == Qt.PrimaryOrientation)

       

      Actual outcomes (contentOrientation == Screen.orientation == Qt.LandscapeOrientation)

       

      Culprit
      https://github.com/qt/qtdeclarative/blob/v6.7.0-beta3/src/quicktemplates/qquickpopuppositioner.cpp#L130-L131 transposes based on orientation, which it shouldn't:

      if (p->window->contentOrientation() == Qt::LandscapeOrientation || p->window->contentOrientation() == Qt::InvertedLandscapeOrientation)
      	bounds = bounds.transposed();
      

      This error probably came from the same source as the one that caused QTBUG-115536 (https://codereview.qt-project.org/c/qt/qtdeclarative/+/518328 )

      Attachments

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

        Activity

          People

            skoh-qt Sze Howe Koh
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes