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. Where is the systray example in QT5.x?
Forum Updated to NodeBB v4.3 + New Features

Where is the systray example in QT5.x?

Scheduled Pinned Locked Moved General and Desktop
9 Posts 2 Posters 4.9k 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.
  • Y Offline
    Y Offline
    yongbin
    wrote on last edited by
    #1

    Hi, I have to work on system tray. I find systray example in internet. but it isn't there in my qt.
    So, I type it my self. But unfortunately when I build it, tray icon does not appear.

    I need a working example. Is there a way to get this example? Any other example for system tray will also great.

    If you know this, please help me. Thank you.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      "QSystemTray":http://qt-project.org/doc/qt-5/QSystemTrayIcon.html help
      "Example from 4.8":http://qt-project.org/doc/qt-4.8/desktop-systray.html I don't think it has changed since then.
      If you install Qt5.3.0 using Qt installer then search at Qt5.3.0/Examples/Qt-5.3/widgets/desktop/systray

      1 Reply Last reply
      0
      • Y Offline
        Y Offline
        yongbin
        wrote on last edited by
        #3

        Thank you, andreyc! The location is where I was looking for.

        The example does not show me system tray icon though.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andreyc
          wrote on last edited by
          #4

          What OS do you use?
          I've tested the example from Qt-5.3.0 and it works on MacOSX and GNU/Linux with Gnome shell.
          Are there any errors in a terminal if you start it from a terminal or in application output panel if you start it from QtCreator?

          1 Reply Last reply
          0
          • Y Offline
            Y Offline
            yongbin
            wrote on last edited by
            #5

            I am using openSUSE13.1 with xfce desktop.

            And... No, there isn't any error message.

            I have both 5.3.0 and 5.0.0 compiler. But neither show me a tray icon.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andreyc
              wrote on last edited by
              #6

              Have you enabled systray applet in xfce?

              I have it enabled but I still don't see icon.
              I can see the messages, which I have not seen without systray applet.
              And there is a clear spot on a panel where I can click and menu from the example will appear.

              I guess that xfce and Qt implementation of "systray protocol":http://standards.freedesktop.org/systemtray-spec/systemtray-spec-0.2.html are a little bit different.

              1 Reply Last reply
              0
              • Y Offline
                Y Offline
                yongbin
                wrote on last edited by
                #7

                Thank you for the useful info andreyc.

                I don't know how to enable systray applet in xfce. Please let me know. :)

                Then what will the best way to work around this? I found a program that show a tray icon which made by Qt. But they use Qt4.

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andreyc
                  wrote on last edited by
                  #8

                  If you have Qt4 app that shows a systray icon then you have systray enabled.
                  It is possible that there is a regression in Qt5 systray implementation.
                  You may try to compare the sources or create a simple example build it with Qt4 and Qt5 and if the results are different submit a bug report.
                  "Here":http://qt-project.org/wiki/ReportingBugsInQt is how to report the bugs in Qt.

                  1 Reply Last reply
                  0
                  • Y Offline
                    Y Offline
                    yongbin
                    wrote on last edited by
                    #9

                    Qt4 shows my system tray icon. So I bug reported.

                    Thank you for all your guides!

                    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