There is no equivalent for the convenience static loadIcon(QString name) function. You have to replace it with KIconLoader::global()->loadIcon(name, KIconLoader::Panel)

There is no equivalent for the convenience static loadIcon(QString name) function. You have to replace it with KIconLoader::global()->loadIcon(name, KIconLoader::Panel)

+

+

The KStatusNotifierItem handles the "Quit" action in the popup menu itself, displaying a confirmation dialogue and calling qApp->quit() if the user confirms. It is not necessary for the application to handle this action itself.

Revision as of 13:15, 19 June 2012

Here is a list of changes to make to your application so that it can take advantage of the new KStatusNotifierItem (KSNI) class, available since KDE 4.4.

Status

An item has a status, which can be set with setStatus(). The host implementation can use this status to adjust the way it presents the item. For example, the Plasma Systemtray applet will automatically hide items with the Passive status by default, making it only visible if you click on the applet expand arrow.

When porting from KSystemTrayIcon, you can replace calls to show() or hide() with setStatus(KStatusNotifierItem::Active) and setStatus(KStatusNotifierItem::Passive) respectively. You can also choose to delete the KSNI instance to hide it, and recreate it when you want to show it.

Misc

There is no equivalent for the convenience static loadIcon(QString name) function. You have to replace it with KIconLoader::global()->loadIcon(name, KIconLoader::Panel)

The KStatusNotifierItem handles the "Quit" action in the popup menu itself, displaying a confirmation dialogue and calling qApp->quit() if the user confirms. It is not necessary for the application to handle this action itself.