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. In KDE + Qt 5.5.1 cannot change system tray icon's context menu items

In KDE + Qt 5.5.1 cannot change system tray icon's context menu items

Scheduled Pinned Locked Moved Unsolved General and Desktop
kdeqt 5.5.1qmenuqsystemtrayicon
3 Posts 3 Posters 1.5k 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.
  • L Offline
    L Offline
    luipugs
    wrote on 25 Feb 2016, 14:55 last edited by
    #1

    I have an app that needs to be able to update the context menu items of its system tray icon. We are using Qt 5.5.1 and we include the Qt libs with the app when we package it so we can't use the system libs. This works in other desktop environments but in KDE the context menu items cannot be changed. It happens in Kubuntu 12.04 until 15.10 and probably in other distributions as well (was able to confirm it on Debian too).

    Steps to reproduce:

    1. Download Qt's official binary installer from https://download.qt.io/archive/qt/5.5/5.5.1/.
    2. Install required packages for Qt Creator. In Kubuntu 12.04 these are g++, libgl1-mesa-dev, and libglu1-mesa-dev.
    3. Download Qt project that contains minimal code to reproduce issue here: https://goo.gl/GZxO6q.
    4. Open Qt Creator: <Qt installation path>/Tools/QtCreator/bin/qtcreator.
    5. Open and run project.
    6. Right click on tray icon and click on the "On" entry. It should change to "Off" when the context menu is reopened.

    Alternative way:

    1. Download the executable with Qt libraries here: https://goo.gl/FYLhIo. It's 64-bit.
    2. export LD_LIBRARY_PATH=/path/to/extracted/folder
    3. cd /path/to/extracted/folder
    4. ./systray
    5. Right click on tray icon and click on the "On" entry. It should change to "Off" when the context menu is reopened.

    Reopening the tray icon's context menu still shows the "On" entry, it was not replaced with "Off". It should show "Off" instead, and clicking it should show "On".

    Also in the Qt project's tray.cpp file, setContextMenu() is called again after the context menu was updated with new items. This is probably a bug in Qt 5.5.1 since the context menu does not show the new items unless setContextMenu() is called again. This happens on all desktop environments.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 25 Feb 2016, 21:23 last edited by
      #2

      Hi,

      Did you check with the KDE folks whether it's something known ?

      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
      • P Offline
        P Offline
        pbe
        wrote on 23 May 2016, 14:14 last edited by
        #3

        I have the same issue with updating the context menu with Qt 5.6 on Ubuntu 16.04 KDE Neo.

        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