Qt编程技巧 右键菜单

1
2
3
4
5
6
7
8
QMenu *menu = new QMenu(tr("Right Contex Menu"),this);
menu->setStyleSheet("background-color : normal");
menu->addAction(Action1);
menu->addAction(Action2);
menu->addAction(Action3);
menu->addSeparator();
menu->addAction(Action4);
menu->exec(event->globalPos());
坚持原创技术分享,您的支持将鼓励我继续创作!