[solved] Restart a Qt application
-
What would be the proper way to restart a Qt application.
After a fatal error the application should offer an option to restarting itself again and I was wondering how this should be done in Qt? -
I actually use this:
@
void MyApp::restartApp()
{
QProcess::startDetached(QApplication::applicationFilePath());
exit(12);
}
@ -
Thank you!
This is exactly what I was looking for. -
works perfectly.Cheers
-
Try to inherit QQuickItem instead of QObject. It is the default for creating QML Objects with QtQuick 2