Unsolved QStackedWidget closeEvent
-
i just tried writing in dtor, but my "main" class is a singleton and destructor isn't called (breakpoint not reached). is this because of singleton?
-
Then you should properly destroy your singleton before the application ends.
-
so, using aboutToQuit()?
-
No, delete it before returning the result of
app.exec()
.By the way, why do you need a singleton for ?
-
it's a game and i made it a singleton
-
I fail to see the motivation of introducing that pattern for a game. Can you give more details ?
-
there can be only one instance of a game that's why i used it
-
Are you handling several games in the application ?
-
no, just one
-
Then there's really no need for a singleton, just instantiate your game object once.