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 Context menu on macOS disabled after updating to Qt5.15.2
Forum Updated to NodeBB v4.3 + New Features

QSystemTrayIcon Context menu on macOS disabled after updating to Qt5.15.2

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 594 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.
  • V Offline
    V Offline
    vgorbik
    wrote on last edited by
    #1

    Re: QSystemTrayIcon: Menu gets disabled if no window has focus
    I'm facing similar problem as described in the topic above.
    On macOS tray icon menu is greyed out and actions are not enabled when I click on any of them. We use Cocoa plugin and implement AppDelegate to handle dock clicks and main menu clicks. AppDelegate is set before the creation of QApplication, and the tray icon's context menu is disabled all the time (i.e. when application windows are not active or active).
    It works when building with Qt5.8.0 on macOS 10.15 and macOS 11.0.
    The simple tray icon context menu created in a small app works with Qt5.15.2.

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

      Hi and welcome to devnet,

      Can you provide a minimal compilable example that shows that issue ?

      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
      • V Offline
        V Offline
        vgorbik
        wrote on last edited by
        #3

        Thank you, it was the same cause as described in the topic linked in the first post. I overlooked it at first and thought the Cocoa initialization happened before QApplication, whereas it wasn't.

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

          So you mean you got it working ?

          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
          • V Offline
            V Offline
            vgorbik
            wrote on last edited by
            #5

            Yes, I got it working correctly.

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

              Then please mark you thread as solved :-)

              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

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved