Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QSystemTrayIcon broken in 4.8.0 under Linux
Forum Updated to NodeBB v4.3 + New Features

QSystemTrayIcon broken in 4.8.0 under Linux

Scheduled Pinned Locked Moved General and Desktop
8 Posts 4 Posters 5.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    It seems that QSystemTrayIcon is broken in Qt 4.8.0 running under Ubuntu 11.10. My app uses QSystemTrayIcon to install an icon/menu in the system tray, but the icon no longer gets installed in the tray. The app still works under OS X/Lion. The problem can be easily reproduced by building the Qt example app systray which exhibits the same problem. Thank you in advance for any advice.

    Regards,
    Osider

    1 Reply Last reply
    0
    • T Offline
      T Offline
      t3chNo
      wrote on last edited by
      #2

      Ubuntu 11.10 that uses Unity has a "white list" for system tray icons. You have to add your app to white list or change settings to show all icons. Take a look at "here":http://ubuntuforums.org/showthread.php?t=1737589

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Thanks for your reply t3chNo.

        I visited the link you mentioned and tried it's solution with my app to no avail. I was not expecting it would work because if I run a version of my program built with Qt 4.7.4, it works just fine. However, if I use the very same source code to built the app with Qt 4.8.0 it does not. I even did a fresh installation of Ubuntu 10.11 and got the same results. I have no choice but to conclude that something is amiss with QSystemTrayIcon in 4.8.0.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          KA51O
          wrote on last edited by
          #4

          Please file a bugreport at "JIRA":https://bugreports.qt-project.org/secure/Signup!default.jspa

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            Before I file a bug report I wonder if someone could try this minimal program to verify the bug. I want to make sure the problem is not with my Ubuntu system. This minimal app runs just fine under MacOSX/Lion but it does not display the tray icon when built under Ubuntu 11.10 using the Unity desktop. In both cases I'm using Qt 4.8.0. In the test app I use the icon file (heart.svg) that comes with the Qt example program System Tray Icon (systray).

            @#include <QtGui>

            int main(int argc, char *argv[])
            {
            QApplication app(argc, argv);
            QLabel win("There should be a new icon in the system tray");
            win.setMargin(20);

            QSystemTrayIcon trayIcon(QIcon("/<absolute path to file>/heart.svg"));
            trayIcon.show();
            
            win.show();
            return app.exec&#40;&#41;;
            

            }
            @

            Thanks in advance for any help.

            Osider

            1 Reply Last reply
            0
            • B Offline
              B Offline
              broadpeak
              wrote on last edited by
              #6

              I cannot see this line:
              app.setQuitOnLastWindowClosed(false); // is a must line in this case
              (this line is before QSystemTrayIcon trayIcon(...);)

              1 Reply Last reply
              0
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7

                [quote author="broadpeak" date="1328295152"]I cannot see this line:
                app.setQuitOnLastWindowClosed(false); // is a must line in this case
                (this line is before QSystemTrayIcon trayIcon(...);)[/quote]

                @broadpeak,

                I don't think it is needed in this minimal app since I'm creating a QLabel as top widget. This minimal app is not very functional. It just displays the QLabel as top widget and installs the the tray icon. If you click on the tray icon, nothing happens since there is neither a menu associated with it, nor a connection with any signal. To end the app just close the top widget.

                When writing the minimal app I tried using setQuitOnLastWindowClosed(false) and no top widget. It works too, but it was hard to quit the app. So, for simplicity sake, I decided to go that way.

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #8

                  I filed bug report QTBUG-24085. In the meantime I'm folding back to Qt 4.7.3 downloaded from the Ubuntu Software Center. This older version of Qt does not have the bug.

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved