I updated the code as follows still the error coming as QSystemTrayIcon::setVisible: No Icon set
void foo ::createTrayIcon()
{
tray->setContextMenu(cmenu);
tray->setIcon(icon);
tray->setVisible(true);
setWindowIcon(icon);
tray->show();
}
{
switch (reason) {
tray->show();
break;
// showMessage();
break;
default:
;
}
void foo ::createTrayIcon()
{
QIcon icon;
icon = QIcon(QPixmap( ":/images/new.png" ) );
tray = new QSystemTrayIcon(icon,this);
tray->setContextMenu(cmenu);
tray->setIcon(icon);
tray->setVisible(true);
setWindowIcon(icon);
tray->show();
connect(tray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
}
void foo::iconActivated(QSystemTrayIcon::ActivationReason reason)
{
switch (reason) {
case QSystemTrayIcon::Trigger:
tray->show();
case QSystemTrayIcon::DoubleClick:
break;
case QSystemTrayIcon::MiddleClick:
// showMessage();
break;
default:
;
}
To copy to clipboard, switch view to plain text mode
Plz give some idea regarding this.................thanks in advance.....
Bookmarks