Qt Forum

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

    Which message clicked for QSystemTrayIcon

    General and Desktop
    2
    4
    1003
    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.
    • J
      jdarnold last edited by

      Is there any way of figuring out which message was clicked when I get the messageClicked signal from my QSysTrayIcon? If my app puts up a couple in a row, I would like to know which one was clicked on when that signal fires.

      1 Reply Last reply Reply Quote 0
      • raven-worx
        raven-worx Moderators last edited by

        what do you mean with "my app puts up a couple in a row"? A couple of QSystemTrayIcons?
        If so each QSystemTrayIcon object emits the signal. Thus you can do the mapping.
        You could use QSignalMapper in that case for example.

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply Reply Quote 0
        • J
          jdarnold last edited by

          No, it calls the tray icon's ShowMessage twice in a row. And it is connected to the messageClicked, but I'd like to know which of the two systray messages was clicked on.

          1 Reply Last reply Reply Quote 0
          • J
            jdarnold last edited by

            Ah, never mind. I was misinformed - at least on Windows, you can't have more than one message showing via the showMessage method. The later one just replaces any one that is currently showing.

            That's what I get for asking about a reported bug before actually trying to recreate it...

            1 Reply Last reply Reply Quote 0
            • First post
              Last post