Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
5.15.0
-
None
Description
With a two monitor setup (same monitors, same resolution on both: 1920x1080), QToolButton opens its menu in the primary monitor only, regardless which monitor has the application MainWindow.
The following minimal code reproduces this for me without a miss:
#include "mainwindow.h" #include <QToolBar> #include <QToolButton> #include <QMenu> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { QToolBar *tb = new QToolBar; addToolBar(tb); QToolButton *tool = new QToolButton; tb->addWidget(tool); tool->setText("Test tool"); QMenu *menu = new QMenu(tool); tool->setMenu(menu); menu->addAction("Action 0"); tool->setPopupMode(QToolButton::ToolButtonPopupMode::InstantPopup); }
And the main function:
#include "mainwindow.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.resize(800, 600); w.show(); return a.exec(); }
Attachments
Issue Links
- duplicates
-
QTBUG-84462 QToolButton popup menu only shows on primary screen
- Closed