View Full Version : Tray notification popup with buttons(like accept, reject)

11th September 2008, 08:40

I'm writing a fronted for Synergy. There will be some code that will execute in defined interval. After that, it will search and popup a message near to tray. The user will be asked for accepting or rejecting.

Now theoritik it's possible, but QSystemTrayIcon's showMessage() only support plain text. It shows and you have to click on this message or not.

But i would like that it has buttons, and the user clicked on that. Like that:


This popup is implented in qt3. But i'm using Qt4 and PyQt4

Any ideas how to implent something like that?

11th September 2008, 12:07
You have to create your own popup widget from scratch and probably use QWidget::setMask to obtain the shape you want.

12th September 2008, 07:57
Thanks for the tip, but i found an easy way to do it. I've used dbus notification and it just work


The code can be looked here:


12th September 2008, 11:35
So long portability :) Try running your application on WindowMaker or Windows ;)

12th September 2008, 12:56
That's right, i didn't think in this way. But it uses avahi too, and aim to be work only on Linux.

12th September 2008, 13:03
What about Linux running a window manager not supporting dbus notifications?

12th September 2008, 13:11
Well dbus has to be installed because of avahi. Avahi do not has an api for Python, only bindings which communicate trough dbus. But you're right, in the future i've have to rewrite some parts of the code.