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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.15.2
    • Fix Version/s: None
    • Component/s: Quick: Controls 2
    • Labels:
      None
    • Platform/s:
      Linux/X11

      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

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

          Activity

            People

            Assignee:
            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Reporter:
            yuyichao Yichao Yu
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes