I changed int argc, char *argv[] in the class constructor to int& argc, char **argv and everything worked
This solution was found when I tried to create a second window of the application