Ubuntu – Using AppIndicators with the Qt framework

application-developmentindicatorqt

Is there a class or library somewhere that makes it easy to use the new AppIndicator framework from within a Qt application?

It seems strange that I should have to include GTK headers / libraries etc. just to create an indicator in Qt.

Is there a better way?

Best Answer

appmenu-qt is about exposing the menubar of Qt/KDE applications so that it appears in Unity panel. It is not about appindicators.

There is no explicit API to use appindicators from a Qt applications now. There should be one for Ubuntu 12.04. Until this is available, the two possible solutions are:

  • Use the QSystemTrayIcon and ensure your users install the sni-qt package (sni-qt transparently turns a QSystemTrayIcon into a StatusNotifierItem|AppIndicator)
  • Use the KStatusNotifierItem class from kdelibs