I am collecting usage stats for my applications which include how much each session lasts. However, I can't seem to be able to save this information because None Of the signals I tried yet actually succeeds to call my report_session function.
This are the signals I have already tried:
- lastWindowClosed()
- aboutToQuit()
- destroyed()
Either these signals never get emitted or the application does not live long enough after that to run anything else. Here is my main:
app = QtGui.QApplication(sys.argv)
ui = MainWindow()
ui.app = app
QtCore.QObject.connect(ui, QtCore.SIGNAL("destroyed()"), ui.report_session)
ui.show()
logger.info('Started!')
splash.finish(ui)
sys.exit(app.exec_())