When my app is running, if the user logs off I would like to pop up a window displaying some info and confirming the logout
class MyApp(QtWidgets.QApplication):
def __init__(self, *args, **kwargs):
super(MyApp, self).__init__(*args, **kwargs)
self.commitDataRequest.connect(lambda manager: self.commitData(manager))
@QtCore.pyqtSlot(QtGui.QSessionManager)
def commitData(self, manager):
print 'shutdown'
if __name__ == '__main__':
qapplication = MyApp(sys.argv)
QtWidgets.QApplication.setQuitOnLastWindowClosed(False) #interaction through tray icon
application.exec_()
The issue is that it's not going into that slot method.
My app does not have a main window, its interfaces through the tray icon.