URGENT : How to Show Another Window From MainWindow in QT using c++
-
@Jasmin-Quinn okay fine, I repeat that my first post is the solution to this application integration.
I repost the working solution. (I tried integrating github project which is working fine )
Solution as per the existing implementation of chessboard application (Just to make the integration works fine)
1)Copy the required files(chess project files) to the existing project.2)In Mainwindow.cpp create the global game object pointer;
Game *game=nullptr;
//make sure Game *game; exists only in the Mainwindow.cpp
//Earlier crash was because there were two instance game * one in Manwindow.h as member variable and other with main.cpp.3)In Mainwindow.cpp include the game.h file
#include "game.h"4)In on_lancer_partie_clicked() create the instance of it
game = new Game();
game->show();
game->displayMainMenu();Note: Assumption that github code remains unaltered.
wrote on 28 Apr 2021, 10:22 last edited by@nagesh IT WORKKKSSS Thank youu !! How did i not think of that
-
wrote on 28 Apr 2021, 17:38 last edited by
Is it correct to say that now the "main project" has all the code of "chess" added so basically there is only one application running?
The objective to "have two windows" has been met, however, adding more "child applications" using same philosophy of "cut and paste" is not what " reusing code " means to me.
41/42