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. Qt-5 systray example problems

Qt-5 systray example problems

Scheduled Pinned Locked Moved General and Desktop
10 Posts 3 Posters 2.4k Views
  • 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.
  • D Offline
    D Offline
    dappy
    wrote on last edited by
    #1

    I'm running Ubuntu 14.04, and I’ve tried running the Qt 5.4 example widgets/desktop/systray but I'm getting the error: "I couldn't detect any system tray on this system." However, an older qt4.7 executable (non-related to this specific example) that has made use of QSystemTrayIcon works just fine. Any idea how to fix this?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dappy
      wrote on last edited by
      #2

      One other thing, the qt-4.7 executable was not compiled on my system, so it appears to be something wrong with my current compiling system.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to devnet,

        Can you check if you also experience this with the Qt 5 version from your distribution ?

        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
        • D Offline
          D Offline
          dappy
          wrote on last edited by
          #4

          So just to clarify, the Qt5 systray example is the one that I'm having problems with, it is the one that gives the error. I actually found a precompile (not from my system) Qt-4.7 systray executable, which is very similar in source code, with a few differences in Qt4/Qt5 formats. This Qt-4.7 precompiled systray example works. I can't figure out how to re-compile the 4.7 code on my system cause I'm a noob. I'm using the online installer form of qtcreator to do my compiling. I might be able to compile the 4.7 source code using qmake if I had some assistance. Thank you.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dappy
            wrote on last edited by
            #5

            Breaking down the code a bit, it appears that there is an error in the way QT5 is reading QSystemTrayIcon::isSystemTrayAvailable(). I know that my system has it available, but Qt5 is not understanding it. I've tried to just comment out that area of the example code, but it runs the program without a systray icon; like having an invisible try icon.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Again, are you experiencing the same if you use your distro Qt 5 packages ? If not then you can compare their sources and see if there's any patch applied by the Ubuntu devs.

              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
              • D Offline
                D Offline
                dappy
                wrote on last edited by
                #7

                Sorry I didn't understand what you wanted, I did try with my distro's Qt5 and its the same deal.

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  dappy
                  wrote on last edited by
                  #8

                  Ok, I want to thank you all for your help, I think I figured out what the problem was. Ubuntu 14.04 is not functional when it comes to Qt5 and QSystemTrayIcon. I have to use Qt4, which was just a matter setting the compiler options to compile with Qt4.8 instead of Qt5. I found 1 work around for Qt5 + SystemTray, but IMO it really wasn't that good, because it used gtk+ embedded into Qt5 which was ugly. Maybe Qt5 will work with the next LTS! Hopefully anyway.

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

                    Hi,
                    I'm on Ubuntu 14.10. Here QSystemTrayIcon works with manually installed Qt 5.4 from qt.io and also with Qt 5 from the Ubuntu SDK.

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

                      The information I gave in the last post was incomplete. QSystemTrayIcon::isSystemTrayAvailable() returns true and a tray icon can be added to the tray but it's shown in the wrong place. This bug is said to be fixed in Qt 5.5.0 Alpha: https://bugreports.qt.io/browse/QTBUG-31762

                      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