Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.3.1
-
None
Description
Hello,
I have noticed that when switching from a small laptop screen to an external monitor with higher resolution the QMenu position on a QSystemTrayIcon is not respected.
This only happens if I launch it on the small laptop screen and then switch, launching it on the monitor will result in the QMenu having the correct position even after switching between screens.
There was one previously reported problem around this in Qt 5.9, that has since been marked as resolved: QTBUG-63006
Please see below code example that causes the problem on my laptop.
#include <QtWidgets/QApplication> #include <QtGui/QIcon> #include <QtWidgets/QSystemTrayIcon> #include <QtWidgets/QMenu> int main(int argc, char *argv[]) { QApplication app(argc, argv); QMenu* menu1 = new QMenu(); QIcon trayIconIcon("iconPath"); QSystemTrayIcon *trayIcon = new QSystemTrayIcon(trayIconIcon); menu1->addAction("Test"); trayIcon->setContextMenu(menu1); trayIcon->setVisible(true); return app.exec(); }