diff options
author | Friedemann Kleint <[email protected]> | 2014-03-10 10:53:49 +0100 |
---|---|---|
committer | The Qt Project <[email protected]> | 2014-03-13 13:39:54 +0100 |
commit | b8afc009afcca84a3fd3d5617dfe96c729c531aa (patch) | |
tree | 10bdbfb63b3aee36da0344cd8f05184b06b47f37 /src/quick/scenegraph/qsgthreadedrenderloop.cpp | |
parent | d6e932b3682c7f8cd610d7554a52c9856d7e67c1 (diff) |
Consolidate context creation failure handling in Quick.
Add QQuickWidget::sceneGraphError() equivalent to
QQuickWindow::sceneGraphError(), move message formatting code
to QQuickWindowPrivate.
Change-Id: I18cd4d7e0f6ee1011c29375218dc6a044b0d2cf2
Reviewed-by: Laszlo Agocs <[email protected]>
Diffstat (limited to 'src/quick/scenegraph/qsgthreadedrenderloop.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgthreadedrenderloop.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index f639841588..ba8c3a7fce 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -946,19 +946,10 @@ void QSGThreadedRenderLoop::handleExposure(Window *w) w->thread->gl->setShareContext(QSGContext::sharedOpenGLContext()); w->thread->gl->setFormat(w->window->requestedFormat()); if (!w->thread->gl->create()) { + const bool isEs = w->thread->gl->isES(); delete w->thread->gl; w->thread->gl = 0; - QString formatStr; - QDebug(&formatStr) << w->window->requestedFormat(); - QString contextType = QLatin1String("OpenGL"); - const char *msg = QT_TRANSLATE_NOOP("QSGThreadedRenderLoop", - "Failed to create %1 context for format %2"); - QString translatedMsg = tr(msg).arg(contextType).arg(formatStr); - QString nonTranslatedMsg = QString(QLatin1String(msg)).arg(contextType).arg(formatStr); - bool signalEmitted = QQuickWindowPrivate::get(w->window)->emitError(QQuickWindow::ContextNotAvailable, - translatedMsg); - if (!signalEmitted) - qFatal("%s", qPrintable(nonTranslatedMsg)); + handleContextCreationFailure(w->window, isEs); return; } |