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

Qt.labs.platform.Menu opens at the wrong location with scaling enabled

    XMLWordPrintable

Details

    • Linux/X11
    • f8cf17166c (qt/qtdeclarative/dev) f8cf17166c (qt/tqtc-qtdeclarative/dev) 379e74afdf (qt/qtdeclarative/6.4) 379e74afdf (qt/tqtc-qtdeclarative/6.4)

    Description

      As the title suggests, calling `open(...)` on the `Menu` causes the menu to pop up at the wrong location when another object is passed in to `open`. Works fine with scaling factor is set to 1. Seem that the scaling factor was applied twice...

       

      Code to reproduce (simply run under `qmlscene`)

       

      import QtQuick 2.12
      import QtQuick.Controls 2.15
      import Qt.labs.platform 1.1 as PlatformRectangle {
          id: page
          width: 320; height: 480
          color: "lightgray"    Button {
              id: okbutton
              text: "Ok"
              onClicked: messageContextMenu.open(okbutton)
              x: 50
              y: 100
          }
      
          Platform.Menu {
              id: messageContextMenu        Platform.MenuItem {
                  text: "Test"
              }
          }
      }
      

      Screenshot with 2x scaling (`QT_SCREEN_SCALE_FACTORS=2`)

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              yuyichao Yichao Yu
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes