QT/C++ – Accessing MainWindow UI from a different class
First off it’s a bad idea to create MainGame before you create your QApplication object. If you want to have your MainGame object globally available like this it should be a pointer: MainWindow *Game; int main (int argc, char **argv) { QApplication a (argc, argv); Game = new MainWindow(); Game->show(); int result = a.exec(); delete … Read more