mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 12:53:03 +02:00
Merge pull request #7382 from hyperlogic/tony/crash-fix-focus-out-event
Application: prevent crash on startup when "Crashed" dialog is shown
This commit is contained in:
commit
6f8f5ed15c
3 changed files with 9 additions and 4 deletions
|
@ -452,8 +452,8 @@ Q_GUI_EXPORT void qt_gl_set_global_share_context(QOpenGLContext *context);
|
|||
|
||||
Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) :
|
||||
QApplication(argc, argv),
|
||||
_dependencyManagerIsSetup(setupEssentials(argc, argv)),
|
||||
_window(new MainWindow(desktop())),
|
||||
_dependencyManagerIsSetup(setupEssentials(argc, argv)),
|
||||
_undoStackScriptingInterface(&_undoStack),
|
||||
_frameCount(0),
|
||||
_fps(60.0f),
|
||||
|
@ -1744,6 +1744,11 @@ bool Application::importSVOFromURL(const QString& urlString) {
|
|||
}
|
||||
|
||||
bool Application::event(QEvent* event) {
|
||||
|
||||
if (!Menu::getInstance()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((int)event->type() == (int)Lambda) {
|
||||
((LambdaEvent*)event)->call();
|
||||
return true;
|
||||
|
|
|
@ -381,6 +381,8 @@ private:
|
|||
|
||||
void maybeToggleMenuVisible(QMouseEvent* event);
|
||||
|
||||
MainWindow* _window;
|
||||
|
||||
bool _dependencyManagerIsSetup;
|
||||
|
||||
OffscreenGLCanvas* _offscreenContext { nullptr };
|
||||
|
@ -390,8 +392,6 @@ private:
|
|||
bool _activatingDisplayPlugin { false };
|
||||
QMap<gpu::TexturePointer, gpu::FramebufferPointer> _lockedFramebufferMap;
|
||||
|
||||
MainWindow* _window;
|
||||
|
||||
QUndoStack _undoStack;
|
||||
UndoStackScriptingInterface _undoStackScriptingInterface;
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
#include "Menu.h"
|
||||
|
||||
Menu* Menu::getInstance() {
|
||||
return static_cast<Menu*>(qApp->getWindow()->menuBar());
|
||||
return dynamic_cast<Menu*>(qApp->getWindow()->menuBar());
|
||||
}
|
||||
|
||||
Menu::Menu() {
|
||||
|
|
Loading…
Reference in a new issue