Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.12.4, 5.12.9, 5.15.0
-
macOS 10.15.5 (19F101)
Description
I have a very simple menu in a window:
import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Window 2.12 Window { id: root visible: true width: 640 height: 480 flags: Qt.CustomizeWindowHint | Qt.WindowMinMaxButtonsHint MouseArea { property point previousPosition anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top height: 40 onPressed: previousPosition = Qt.point(mouse.x, mouse.y) onPositionChanged: { root.setX(root.x + mouse.x - previousPosition.x) root.setY(root.y + mouse.y - previousPosition.y) } } Rectangle { anchors.centerIn: parent width: 200 height: width color: 'red' MouseArea { anchors.fill: parent acceptedButtons: Qt.RightButton onClicked: menu.popup() } Menu { id: menu MenuItem { text: 'Item 1' } MenuItem { text: 'Item 2' } MenuItem { text: 'Item 3' } } } }
When the top of the window sticks to the top of the working space (i.e. to the bottom of the standard macOS menu), the menu pops up at the incorrect location. Otherwise it works normally. You can drag by the title bar in order to move the window to the top.
I have also attached the code as a stand-alone project for your convenience.