No picture in system tray

  • Hey you,

    I try to implement a System Tray Icon in my application

    After using the search and several tutorials I already have an Icon, but without any kind of picture. The Icon in the bar is empty.

    I am using the following code in the resource file:

    <qresource prefix="/images“>

    The file is saved in my project directionally where the other files are saved.

    I included the resource file via my .pro file,

    @RESOURCES += res.qrc@

    The creation of the System Tray Icon is in the constructor

    @trayIcon = new QSystemTrayIcon(this);

    As said the icon in already in the bar in the corner of the desktop, but without the picture (favicon.ico).

    Do you have any idea?

    Thank you very much in advance for your help!


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You should add some check to ensure your image is found and loads.

    Also what OS/Qt combo are you using ?

Log in to reply