new function app.oninit to call a function on QApplication instantiation or directly when qApp already exists
fix #444