Qt编程技巧 系统托盘设置

1
2
3
4
5
6
7
8
9
10
11
12
13
trayIcon = new QSystemTrayIcon(this);   //系统托盘

trayMenu = new QMenu(this); //托盘菜单
trayMenu->addAction(Action1);

......

trayMenu->addAction(quitAction10);

connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(show()));

trayIcon->setIcon(QIcon(":/icons/trayIcon.png"));
trayIcon->setContextMenu(trayMenu);
坚持原创技术分享,您的支持将鼓励我继续创作!