以下是模仿酷狗托盘的主要代码:
SystemTray::SystemTray()
: QSystemTrayIcon()
{
this->createActions();
this->createPlayAction();
this->addActions();
this->translateLanguage();
this->setContextMenu(pop_menu);
}
SystemTray::~SystemTray()
{
}
void SystemTray::translateLanguage()
{
this->setToolTip(tr("hey music"));
this->switchPlayToolTip(is_paly);
backward_button->setToolTip(tr("backward"));
forward_button->setToolTip(tr("forward"));
show_action->setText(tr("show"));
setting_action->setText(tr("setting"));
lock_lrc_action->setText(tr("lock