Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.15.0
-
None
-
Gentoo Linux, KDE 5.18.5
Description
I have 2 displays:
1) laptop/primary 1920x1080 (left)
2) hdmi/secondary 2560x1080 (right)
And I have widgets based Qt-only application with a toolbar. Some actions added to the toolbar have menu.
If I open this menu (by clicking the toolbar button) on the primary display it's shown properly. If I move the application window to the secondary display and click the toolbutton there, the menu is shown on the primiary display aligned to its right edge, while Y coordinate looks valid.
This behavour doesn't depend on menu size. I have 3 affected to these problem menus implemented in different time / different ways but all of them are affected, one of them is very small (a couple of short items). One of the menus comes from a QToolButton being added right to the form instead of QToolBar.
Even so any context menu for the same window or a menu I render manually menu->exec(QCursor::pos()); is shown in the correct position. Menus set to QPushButtons also work properly.
Minimal reproducible example
#include <QApplication> #include <QMenu> #include <QToolButton> int main(int argc, char **argv) { QApplication app(argc, argv); auto button = new QToolButton(); button->setText("button"); button->setPopupMode(QToolButton::InstantPopup); QMenu *menu = new QMenu(button); menu->addAction("item"); button->setMenu(menu); button->show(); return app.exec(); }
Attachments
Issue Links
- duplicates
-
QTBUG-86067 Toolbar pop-ups show up on the far-left (first) monitor not below the toolbar
- Closed