Hi all, I've created a simple app with system tray icon but seems like when using Qt 5 it throws an error message, but works. Maybe recipes that worked for Qt 4 on Mac OS X are not valid anymore for Qt 5?

Here's a code sample from Qt Creator:

Header (.h)
Qt Code:
  1. #include <QSystemTrayIcon>
To copy to clipboard, switch view to plain text mode 

Implementation (main.cpp)
Qt Code:
  1. #include "mainwindow.h"
  2. #include <QApplication>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. QApplication a(argc, argv);
  7. MainWindow w;
  8. w.show();
  9.  
  10. return a.exec();
  11. }
To copy to clipboard, switch view to plain text mode 

Implementation (pieces of mainwindow.cpp)
Qt Code:
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3. #define TRAY_ICON ":/trayicon.png"
  4.  
  5. MainWindow::MainWindow(QWidget *parent) :
  6. QMainWindow(parent),
  7. ui(new Ui::MainWindow)
  8. {
  9. ui->setupUi(this);
  10. QIcon trayIcon = QIcon( TRAY_ICON );
  11. QSystemTrayIcon *tray = new QSystemTrayIcon(this);
  12. tray->setIcon(trayIcon);
  13. tray->show();
  14. }
To copy to clipboard, switch view to plain text mode 

When I start the app it throws this:
QObject::connect: No such slot QSystemTrayIcon::emitActivated(QPlatformSystemTray Icon::ActivationReason)
There is no such error message when compiled with Qt 4.8.4