I am writing an application using QSystemTrayIcon . Everything works as expected, but the icon does not appear in the Unity notification area in the upper right corner, but only in the upper left corner.
The current build environment is clang 3.4, QT 5.3 is Ubuntu 14.04. When cross-compiling with MinGW and starting the application in the fault, the icon is displayed correctly.
Perhaps this is a bug in Ubuntu?
Here is a simple snippet that produces the same behavior:
#include <QSystemTrayIcon> #include <QApplication> int main(int argc, char *argv[]) { QApplication app(argc, argv); QPixmap pixmap(32, 32); pixmap.fill(Qt::red); QIcon icon(pixmap); QSystemTrayIcon trayIcon(icon); QObject::connect(&trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), &app, SLOT(quit())); trayIcon.show(); return app.exec(); }
source share