Results 1 to 2 of 2

Thread: Qt 5 QSystemTrayIcon throws error message on Mac OS X

  1. #1
    Join Date
    Mar 2013
    Posts
    1
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Qt 5 QSystemTrayIcon throws error message on Mac OS X

    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

  2. #2
    Join Date
    Aug 2011
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: Qt 5 QSystemTrayIcon throws error message on Mac OS X

    I get the same error in my application. Also some menu entries are missing.

Similar Threads

  1. Replies: 3
    Last Post: 5th May 2012, 06:03
  2. Replies: 7
    Last Post: 3rd December 2010, 06:02
  3. error message
    By offline in forum Qt Programming
    Replies: 1
    Last Post: 5th November 2009, 15:08
  4. How to show Multiple Message using QSystemTrayIcon?
    By ashukla in forum Qt Programming
    Replies: 5
    Last Post: 22nd May 2009, 11:26
  5. py2app-deployed PyQt app -- throws QObject threading error
    By tory108 in forum Installation and Deployment
    Replies: 4
    Last Post: 20th January 2009, 21:16

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.