i answered my own question.....

On 11/07/2016 11:44 AM, Demosthenes Koptsis wrote:
because there is no window open and quits by default.

You have to do two things:

1) Make sure that your SystemTray class has parent a QWidget

    w = QtGui.QWidget()
    trayIcon = SystemTrayIcon(QtGui.QIcon("virtualdvd.png"), w)

2) set quit to false

    app.setQuitOnLastWindowClosed(False)

----------------------------

Example

----------------------------

def main():
    app = QtGui.QApplication(sys.argv)
    app.setQuitOnLastWindowClosed(False)

    w = QtGui.QWidget()
    trayIcon = SystemTrayIcon(QtGui.QIcon("virtualdvd.png"), w)

    trayIcon.show()
    sys.exit(app.exec_())

if __name__ == '__main__':
    main()

On 11/07/2016 10:49 AM, Anssi Saari wrote:
Demosthenes Koptsis <demosthen...@gmail.com> writes:

Hello, i have a PyQT systray app with a menu and two actions.

Action1 is Exit and action2 display a MessageBox with Hello World message.

When i click OK to MessageBox app quits...why?

http://pastebin.com/bVA49k1C
I haven't done anything with Qt in a while but apparently you need to
call QtGui.QApplication.setQuitOnLastWindowClosed(False) before
trayIcon.show().


--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to