[PyQt] problem with QSystemTrayIcon

Rafał Zawadzki bluszcz at jabberpl.org
Thu Feb 21 10:44:10 GMT 2008


Hello. I am using python-qt4 on kubuntu 7.10.

I found a very strange behaviour in the below code:

* after exit (choose Quit from menu on systray icon application segfaults)
* showMessage is showed centered on the screen - in class reference it is 
connected with systracicon.

I suppose that these above are bugs. Anyone could check this?

import sys
from PyQt4.QtCore import SIGNAL
from PyQt4.QtGui import QApplication
from PyQt4.QtGui import QIcon
from PyQt4.QtGui import QMenu
from PyQt4.QtGui import QAction
from PyQt4.QtGui import QSystemTrayIcon
from PyQt4.QtCore import QString
from PyQt4.QtCore import SLOT

if __name__ == "__main__":
    app = QApplication(sys.argv)
    plik = QString("/usr/share/icons/crystalsvg/16x16/apps/wine.png")
    menu = QMenu()
    quitAction = menu.addAction('Quit')
    sicon = QIcon(plik)
    tray = QSystemTrayIcon(sicon)
    tray.setContextMenu(menu)
    tray.show()
    quitAction.connect(quitAction, SIGNAL("triggered()"), app, SLOT("quit()"))
    #atray.connect(tray, SIGNAL("clicked()"))
    tray.setToolTip("Ale czad!")
    tray.showMessage("Title of the message", "Body of the message")
    sys.exit(app.exec_())

Regards,

-- 
Rafał bluszcz Zawadzki 
http://my.jabberpl.org - use jabber
http://glam.pl - try secondhand clothes
http://bluszcz.net - my homepage
http://dkf.glam.pl - domorosły krytyk filmowy



More information about the PyQt mailing list