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 in Linux
Forum Updated to NodeBB v4.3 + New Features

QSystemTrayIcon in Linux

Scheduled Pinned Locked Moved General and Desktop
7 Posts 5 Posters 2.9k Views 3 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.
  • S Offline
    S Offline
    SujaMM
    wrote on last edited by
    #1

    I'm working in an app that creates a TrayIcon on the system, it's working perfectly on Windows but it's not showing in linux. I'm not sure if it's the version of linux. I left here the code I'm ussing.

     if (QSystemTrayIcon::isSystemTrayAvailable()) {
        trayIcon = new QSystemTrayIcon(this);
        trayIcon->setIcon(QIcon(":/Imagenes/iconosPERFQ-23.png"));
        trayIcon->setToolTip(tr("PerfQ Client"));
        trayIcon->setVisible(true);
        connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
                     this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
    }
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Did you check whether isSystemTrayAvailable returns false ?

      If not, what distribution are you using ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • mrdebugM Offline
        mrdebugM Offline
        mrdebug
        wrote on last edited by
        #3

        I have a similar problem. The tray icon in Linux is shown in the top left corner instead of the right bottom corner, if I run the application as normal user. That happens on Debian 7.
        On Windows and Mac all well.

        Need programmers to hire?
        www.labcsp.com
        www.denisgottardello.it
        GMT+1
        Skype: mrdebug

        XPlatformsX 1 Reply Last reply
        0
        • mrdebugM mrdebug

          I have a similar problem. The tray icon in Linux is shown in the top left corner instead of the right bottom corner, if I run the application as normal user. That happens on Debian 7.
          On Windows and Mac all well.

          XPlatformsX Offline
          XPlatformsX Offline
          XPlatforms
          wrote on last edited by
          #4

          @mrdebug do you use KDE? Have saw same issue on KDE4 Desktop using Qt4 apps.

          @SujaMM Which Linux distribution do you use and which Desktop environment?

          1 Reply Last reply
          0
          • mrdebugM Offline
            mrdebugM Offline
            mrdebug
            wrote on last edited by
            #5

            Debian 7 with kde 4.8.4
            But if I run my application from user console as root user by sux, the tray icon will be right, in the bottom right corner of the screen.

            Need programmers to hire?
            www.labcsp.com
            www.denisgottardello.it
            GMT+1
            Skype: mrdebug

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

              Hi everyone,
              this bug is fixed in Qt 5.5.0 Alpha; see: https://bugreports.qt.io/browse/QTBUG-31762

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SujaMM
                wrote on last edited by
                #7

                The trayIcon it's only apearing when I run the runable create in the build folder, how ever it dosen't show when I run it on Qt Creator or from the terminal.
                The other problem it's that I detroy the trayicon when I close each window and create a new one to avoid having a buch of trayicons in the system tray. But this it's not working in linux.

                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