Questions tagged [qsystemtrayicon]

30 questions
3
votes
1 answer

popup window from tray icon that doesn't close the program when the window is closed

Setting up a toolkit that launches different applications from a tray Icon and I need to be able to open the configuration window and then close it without closing the entire application. import sys from PyQt5.QtWidgets import QSystemTrayIcon,…
sidnical
  • 421
  • 1
  • 6
  • 23
3
votes
1 answer

QSystemTrayIcon.setIcon not working to change the tray icon

import sys from PyQt5.QtWidgets import QSystemTrayIcon, QApplication, QMenu from PyQt5.QtGui import QIcon class autoparse(): def __init__(self): self.main() def main(self): app = QApplication(sys.argv) …
sidnical
  • 421
  • 1
  • 6
  • 23
3
votes
2 answers

PyQT5 QSystemTrayIcon activated signal not working

I am trying to print a text when system tray icon is clicked in PyQT5 program. I tried to connect PyQT5 QSystemTrayIcon activated signal (emitted when system tray icon is clicked) to custom method, but the method is not called. Here is simple…
Filip Happy
  • 575
  • 5
  • 17
2
votes
1 answer

How to add a action to the context menu from a function QSystemTrayIcon

I have tried searching the PySide6 docs for information about the QMenu and QSystemTray classes but I was unable to find any information about adding actions to the context menu from a function. Here is the code that I have tried: from…
Evolve255
  • 23
  • 3
2
votes
0 answers

Win toast / balloon notifications stopped working recently on windows 10 with Qt

To me it seems windows balloon messages stopped working completely some weeks ago on windows 10. In August 2019 the following code based on Qt could be used to post a notification in the windows action center, and letting a toast pop up with that…
user1882245
  • 101
  • 1
  • 4
2
votes
0 answers

QSystemTrayIcon signals not emitting on mouse click in Ubuntu 19.04

I have just installed Ubuntu 19.04 and I'm using the Qt distribution it provides in the apt-get repo. I'm seeing that the QSytemTrayIcon signals do not emit upon mouse click. I'm aware of the issues with "activated" signal so I also connected a slot…
anshah
  • 105
  • 9
2
votes
1 answer

PyQt5: how do I launch a window from a system tray icon context menu?

I have two separate files, one that creates a system tray icon and context menu, and another a window to take user input. traywindow.py contains this: import sys import os from PyQt5 import QtCore, QtWidgets from PyQt5.QtWidgets import QMainWindow,…
Sidewinder
  • 369
  • 3
  • 13
2
votes
2 answers

How to handle mouse right click on QSystemTrayIcon?

I have connected QSystemTrayIcon::ActivationReason to my 'handleClick' slot as below connect(tray,SIGNAL(activated(QSystemTrayIcon::ActivationReason)),…
GUI-Novice
  • 351
  • 5
  • 17
1
vote
1 answer

Implement Popup mapping in QSystemTrayIcon

I want to implement behaviour of a popup-window exactly like default volume controller in windows 10. One click on icon, window opens or closes; if window is opened, clicking outside it will close the window. How can i implement this? Before, i…
1
vote
1 answer

QSystemTrayIcon does not return any geometry information

I'm using Ubuntu (17.04) with the Unity desktop. I'm unable to get any geometry information for QSystemTrayIcon: trayIconMenu = new QMenu(this); trayIcon = new QSystemTrayIcon(this); trayIcon->setContextMenu(trayIconMenu); QPixmap…
Ankur Shah
  • 125
  • 12
1
vote
1 answer

How to distinguish between left and right click with QSystemTrayIcon

Problem When running the following PyQt5 code on MacOS (Sierra 10.12.6) self.tray_icon = QtWidgets.QSystemTrayIcon(QtGui.QIcon("icon/path"), self) self.tray_icon.activated.connect(self.on_systray_activated) [...] def on_systray_activated(self,…
sunyata
  • 1,843
  • 5
  • 27
  • 41
1
vote
0 answers

QSystemTrayIcon without context menu in Qt5 possible?

I am using QSystemTrayIcon for the first time, and it was trivial to implement. My code looks like this: if(!connect(mTrayIcon, &QSystemTrayIcon::activated, this, &MiniStudio::onTrayActivated)) { qWarning()<<"ERROR: could not connect…
Mr. Developerdude
  • 9,118
  • 10
  • 57
  • 95
0
votes
0 answers

QSystemTrayIcon disappears on Ubuntu 20.04/22.04 after reboot

My Qt Application shows the QSystemTrayIcon on fresh install but after reboot or logout/login I see the QSystemTrayIcon disappears from UI on startup. I am seeing this issue on 20.04 and 22.04. 18.04 works no issues. My implementation is…
anshah
  • 105
  • 9
0
votes
0 answers

How to prevent QSystemTrayIcon's contextMenu from hiding when clicked?

I'm trying to enable users to click on an action in a QSystemTrayIcon's contextMenu multiple times without making it hide, which happens by default. I tried to show the contextMenu when an action is triggered (clicked), so it makes it show up after…
0
votes
1 answer

PyQt6 QSystemTrayIcon.Information no longer works

I was using Python 3.7.9 with PyQt5 and I was able to leverage the QSystemTrayIcon to display the Information icon without issue. This is what the system message displays when using PyQt5. I recently upgraded to 3.11.1 and since I was redownloading…
Alex B
  • 15
  • 4
1
2