It is not safe to use pixmaps outside the GUI thread
<p>rebz! This code is not working - icon full transperent. I'll never know what to do.</p>

<pre><code>class SystemTrayIcon:
def __init__(self, icon_app, icon_pause, icon_work, parent=None):
    self.STATUS_WORK = 2
    self.STATUS_PAUSE = 1
    self.STATUS_APP = 0

    self.tray = QSystemTrayIcon(icon_app, parent)
    api.gui.connector.connect_slot(object_name=)
    self.icons = {
        0:icon_app,
        1:icon_pause,
        2:icon_work
    }

    self.menu = QMenu(parent)
    self.tray.setContextMenu(self.menu)
    print self.tray.thread()
    # self.set_status(2)

def set_status(self, status):
    self.tray.setIcon(self.icons[status])
</code></pre>

<p>I call method <strong>set_status</strong> in second thread. Help me please (:</p>

<p>solved a problem:</p>

<pre><code>class SystemTrayIcon:
def __init__(self, icon_app, icon_pause, icon_work, parent=None):
    self.STATUS_APP = 0
    self.STATUS_PAUSE = 1
    self.STATUS_WORK = 2

    self.tray = QSystemTrayIcon(icon_app, parent)
    self.icons = {
        0:icon_app,
        1:icon_pause,
        2:icon_work
    }

    self.menu = QMenu(parent)
    self.tray.setContextMenu(self.menu)
    print self.tray.thread()
    self.tray.connect(self.tray, SIGNAL("change_status(int)"), self.set_status)
    # self.set_status(2)

def set_status(self, status):
    self.tray.setIcon(self.icons[status])
</code></pre>

<p>and another thread: 
<code>tray.emit(SIGNAL("change_status(int)"), STATUS_PAUSE)</code></p>

python multithreading qt