Я хочу создать DropDownMenu в Qt, и я не могу установить метку для моей кнопки, какое всплывающее меню. У меня есть этот код.
QToolBar* toolBar = new QToolBar();
QMenu* menu = new QMenu();
QAction* testAction = new QAction("test menu item", this);
QAction* testAction1 = new QAction("test menu item", this);
QAction* testAction2 = new QAction("test menu item", this);
menu->addAction(testAction);
menu->addAction(testAction1);
menu->addAction(testAction2);
QToolButton* toolButton = new QToolButton();
toolButton->setMenu(menu);
toolButton->setPopupMode(QToolButton::InstantPopup);
toolBar->addWidget(toolButton);
Меню в левом верхнем углу. Как можно установить ярлык к нему? 