Just use QCoreApplication instead QApplication. All works fine.