Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Qt-5 systray example problems

    General and Desktop
    3
    10
    1997
    Loading More Posts
    • 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
      dappy last edited by

      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 Reply Quote 0
      • D
        dappy last edited by

        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 Reply Quote 0
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          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 Reply Quote 0
          • D
            dappy last edited by

            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 Reply Quote 0
            • D
              dappy last edited by

              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 Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                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 Reply Quote 0
                • D
                  dappy last edited by

                  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 Reply Quote 0
                  • D
                    dappy last edited by

                    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 Reply Quote 0
                    • ?
                      A Former User last edited by

                      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 Reply Quote 0
                      • ?
                        A Former User last edited by

                        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 Reply Quote 0
                        • First post
                          Last post