Why MainWindow in Qt is closing after start the program?

90 views Asked by At

I was working on Windows with this program and was ok.. When im running it on linux (using QT creator, same on windows) window show and hide immediately. The program is to big to paste it all, this is my main.cpp code

int main(int argc, char *argv[]){
    QApplication a(argc, argv);
    MainWindow w;
    w.show(); 
    return a.exec();
}

What should it be?

1

There are 1 answers

1
Alexander V On

If there is no fatal exception that exits the app then the event loop (a.exec()) is quitting due to some event served. So, the visibility is not enough to conclude why your app is quitting on Linux.