[SOLVED] Menu Bar disappears when the app is restarted
-
Hello all!
I have an app with a menu bar and a restart process.
When the app is restarted by the process the menu bar disappears.
I am using OSX 10.9
main.cpp
@
#include "mainwindow.h"
#include <QApplication>#define CODIGO_RESTART 1000
int main(int argc, char *argv[])
{
int codigoSaida = 0;do{ QApplication a(argc, argv); MainWindow w; w.show(); codigoSaida = a.exec(); }while(codigoSaida == CODIGO_RESTART); return codigoSaida;
}
@restart process
@
void MainWindow::reiniciar()
{
qApp->exit(1000);
}
@When I call reiniciar function, the app restarts but the menu bar do not appears
-
Thank you for sharing your solution.
a comment.
I think you don't need a.exit() and the beginning of the loop.
I tested it on Linux and with QApplication under a loop the app looks ugly on second and later iterations. All styling is gone on second iteration.
With QApplication out of the loop and without a.exit() everything works fine on Linux.