Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.1.0 Beta 1
-
None
-
Windows 7 x86, qt-windows-opensource-5.1.0-beta1-msvc2010-x86-offline.exe
-
87b603080a300f865643a7c6c2c62a5cc795343b
Description
// MenuScene.qml import QtQuick 2.1 import QtQuick.Controls 1.0 Rectangle { id: root width: 800 height: 600 Menu { id: rootMenu MenuItem {text: "Item 1"} MenuItem {text: "Item 2"} } MouseArea { anchors.fill: parent onClicked: rootMenu.popup() } }
// widget.cpp Widget::Widget(QWidget *parent): QWidget(parent) { QQuickView* view = new QQuickView(QUrl("MenuScene.qml")); view->setResizeMode(QQuickView::SizeRootObjectToView); QVBoxLayout *layout = new QVBoxLayout(); layout->addWidget(QWidget::createWindowContainer(view)); this->setLayout(layout); }
When clicking inside the window, the menu pops up in the wrong area – It doesn't seem to take into account the widget's position on the screen (e.g. When clicking on the top-left corner of the QQuickView, the menu will pop up in the top-left corner of the screen)
Also, when I move the widget to a secondary screen and click there, the menu still pops up on the primary screen.
Attachments
For Gerrit Dashboard: QTBUG-31659 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
58830,2 | Menu: Support QQuickWindows embedded in QWidgets | stable | qt/qtquickcontrols | Status: MERGED | +2 | 0 |