QmlProfiler: Try harder to obtain a canvas context

The QML canvas is notoriously bad at keeping its context around. This
workaround gives us a valid context in many of these cases.

Change-Id: I6c23aa2b44c10a48cdb89c66a2861ab8d31bcfc8
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2014-09-09 17:42:35 +02:00
parent f3bdba6c77
commit 82793e7339
3 changed files with 3 additions and 7 deletions

View File

@@ -112,8 +112,7 @@ Canvas {
// ***** slots
onPaint: {
if (context === null)
return; // canvas isn't ready
var context = (canvas.context === null) ? getContext("2d") : canvas.context;
Plotter.qmlProfilerModelProxy = qmlProfilerModelProxy;