c++ - Must construct a QApplication before a QWidget -
everywhere "before qpaintdevice" questions , error. so, here go. i need extern qwidget able access outside (because don't know other ways it). basically, need this: create 2 qwidgets 1 window, go first window , there hide main window , show second window created main window (although main window not main(), qwidget too). i added extern qwidget *widget = new qwidget everywhere , everyhow in possible ways, , still got message. suppose, means need create qapplication (in main.cpp) , declare qwidgets. how can access qwidgets qwidgets? code here: https://github.com/ewancoder/game/tree/qwidget_before_qapp_problem p.s. final goal able show , hide both gamewindow.cpp , world.cpp battle.cpp (just regular class) and btw, adding q_object , #include both don't work. anyway, if cannot use functions 1 window another, what's point? can have 1 window in another, , in one, , 1 in another... can't last previous. after years on delphi seems strange me. ...