qtbase systray example http://code.qt.io/cgit/qt/qtbase.git/tree/examples/widgets/desktop/systray The example will create QSystemTrayIcon, and systemtray plasmoid will automatically hide it into unexpanded Status && Notification area. and right click on the systemtray plasmoid, open the systemtray configuration, then set (qtbase) systray (example) as VISIBLE, but it still be hided not shown on the panel directly https://pbs.twimg.com/media/CVMAmBBUsAAOjmG.png KF5: v5.16.0 Qt5: v5.5.1 Reproducible: Always
my ~/.xsession-errors Don't have a parent applet, Can't initialize the Plasmoid protocol!!! QObject::disconnect: No such slot QObject::dataUpdated(QString,Plasma::DataEngine::Data) QObject::disconnect: (sender name: 'org.kde.StatusNotifierItem-17475-1/StatusNotifierItem') QObject::disconnect: (receiver name: 'SystemTray-sogou-qimpanel') QObject::disconnect: No such slot QObject::modelChanged(QString,QAbstractItemModel*) QObject::disconnect: (sender name: 'org.kde.StatusNotifierItem-17475-1/StatusNotifierItem') QObject::disconnect: (receiver name: 'SystemTray-sogou-qimpanel') QObject::disconnect: No such slot QObject::dataUpdated(QString,Plasma::DataEngine::Data) QObject::disconnect: (sender name: ':1.39/StatusNotifierItem') QObject::disconnect: (receiver name: 'SystemTray-62914618') QObject::disconnect: No such slot QObject::modelChanged(QString,QAbstractItemModel*) QObject::disconnect: (sender name: ':1.39/StatusNotifierItem') QObject::disconnect: (receiver name: 'SystemTray-62914618') QObject::disconnect: No such slot QObject::dataUpdated(QString,Plasma::DataEngine::Data) QObject::disconnect: (sender name: 'org.kde.StatusNotifierItem-17485-1/StatusNotifierItem') QObject::disconnect: (receiver name: 'SystemTray-KMix') QObject::disconnect: No such slot QObject::modelChanged(QString,QAbstractItemModel*) QObject::disconnect: (sender name: 'org.kde.StatusNotifierItem-17485-1/StatusNotifierItem') QObject::disconnect: (receiver name: 'SystemTray-KMix') plasma-workspace/applets/systemtray/plugin/protocols/plasmoid/plasmoidprotocol.cpp void PlasmoidProtocol::init() { //this should never happen if (m_containment) { return; } Host* h = qobject_cast<Host*>(parent()); QQuickItem* rootItem = h->rootItem(); if (rootItem) { m_systrayApplet = rootItem->property("_plasma_applet").value<Plasma::Applet*>(); } if (!m_systrayApplet) { qWarning() << "Don't have a parent applet, Can't initialize the Plasmoid protocol!!!"; return; } m_systrayApplet is NULL ptr!
Created attachment 95859 [details] 0004-systray-rootitem.patch applets/systemtray/plugin/protocols/plasmoid/plasmoidprotocol.cpp failed to get rootItem from applets/systemtray/plugin/host.cpp so I dirty add setRootItem for PlasmoidProtocol ... I will try to fix it correctly ASAP ;-)
my ~/.config/plasma-org.kde.plasma.desktop-appletsrc [Containments][1][Applets][6][Configuration][General] extraItems=org.kde.plasma.devicenotifier,org.kde.plasma.printmanager,org.kde.plasma.battery,org.kde.plasma.notifications,org.kde.plasma.mediacontroller,org.kde.plasma.networkmanagement,org.kde.plasma.clipboard,org.kde.plasma.bluetooth,org.kde.plasma.isoftupdate hiddenItems=org.kde.plasma.printmanager knownItems=org.kde.plasma.devicenotifier,org.kde.plasma.isoftupdate,org.kde.plasma.printmanager,org.kde.plasma.battery,org.kde.plasma.notifications,org.kde.plasma.mediacontroller,org.kde.plasma.networkmanagement,org.kde.plasma.clipboard,org.kde.plasma.bluetooth shownItems=org.kde.plasma.clipboard when set systray as shown Item, but systray is not in the showItems!
fixed ;-) https://git.reviewboard.kde.org/r/126229/
since the patch is specific for 5.4 that probably won't have new releases, you can send the patch to kde-packagers@kde.org for distributions that can consider to pick up the patch in their 5.4 packages