mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 03:19:24 +02:00
Fix no-ui crashes
This commit is contained in:
parent
03f51352aa
commit
105a615745
1 changed files with 8 additions and 1 deletions
|
@ -2663,6 +2663,10 @@ Application::~Application() {
|
||||||
void Application::initializeGL() {
|
void Application::initializeGL() {
|
||||||
qCDebug(interfaceapp) << "Created Display Window.";
|
qCDebug(interfaceapp) << "Created Display Window.";
|
||||||
|
|
||||||
|
#ifdef DISABLE_QML
|
||||||
|
setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity);
|
||||||
|
#endif
|
||||||
|
|
||||||
// initialize glut for shape drawing; Qt apparently initializes it on OS X
|
// initialize glut for shape drawing; Qt apparently initializes it on OS X
|
||||||
if (_isGLInitialized) {
|
if (_isGLInitialized) {
|
||||||
return;
|
return;
|
||||||
|
@ -6870,6 +6874,9 @@ bool Application::askToLoadScript(const QString& scriptFilenameOrURL) {
|
||||||
shortName = shortName.mid(startIndex, endIndex - startIndex);
|
shortName = shortName.mid(startIndex, endIndex - startIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DISABLE_QML
|
||||||
|
DependencyManager::get<ScriptEngines>()->loadScript(scriptFilenameOrURL);
|
||||||
|
#else
|
||||||
QString message = "Would you like to run this script:\n" + shortName;
|
QString message = "Would you like to run this script:\n" + shortName;
|
||||||
ModalDialogListener* dlg = OffscreenUi::asyncQuestion(getWindow(), "Run Script", message,
|
ModalDialogListener* dlg = OffscreenUi::asyncQuestion(getWindow(), "Run Script", message,
|
||||||
QMessageBox::Yes | QMessageBox::No);
|
QMessageBox::Yes | QMessageBox::No);
|
||||||
|
@ -6884,7 +6891,7 @@ bool Application::askToLoadScript(const QString& scriptFilenameOrURL) {
|
||||||
}
|
}
|
||||||
QObject::disconnect(dlg, &ModalDialogListener::response, this, nullptr);
|
QObject::disconnect(dlg, &ModalDialogListener::response, this, nullptr);
|
||||||
});
|
});
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue