mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 01:22:08 +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() {
|
||||
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
|
||||
if (_isGLInitialized) {
|
||||
return;
|
||||
|
@ -6870,6 +6874,9 @@ bool Application::askToLoadScript(const QString& scriptFilenameOrURL) {
|
|||
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;
|
||||
ModalDialogListener* dlg = OffscreenUi::asyncQuestion(getWindow(), "Run Script", message,
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
|
@ -6884,7 +6891,7 @@ bool Application::askToLoadScript(const QString& scriptFilenameOrURL) {
|
|||
}
|
||||
QObject::disconnect(dlg, &ModalDialogListener::response, this, nullptr);
|
||||
});
|
||||
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue