forked from qt-creator/qt-creator
QmlProfiler: Don't use the canvas context if it isn't ready
The documentation indicates that onPaint can actually be called while the context isn't ready. Change-Id: I32d861e016e5e990f3d940a35ec28956902041ba Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
@@ -92,6 +92,8 @@ Canvas {
|
||||
|
||||
// ***** slots
|
||||
onPaint: {
|
||||
if (context === null)
|
||||
return; // canvas isn't ready
|
||||
Plotter.qmlProfilerModelProxy = qmlProfilerModelProxy;
|
||||
if (dataReady) {
|
||||
Plotter.plot(canvas, context, region);
|
||||
|
||||
@@ -49,6 +49,8 @@ Canvas {
|
||||
}
|
||||
|
||||
onPaint: {
|
||||
if (context === null)
|
||||
return; // canvas isn't ready
|
||||
context.fillStyle = "white";
|
||||
context.fillRect(0, 0, width, height);
|
||||
|
||||
|
||||
@@ -47,6 +47,8 @@ Canvas {
|
||||
onYChanged: requestPaint()
|
||||
|
||||
onPaint: {
|
||||
if (context === null)
|
||||
return; // canvas isn't ready
|
||||
drawBackgroundBars( context, region );
|
||||
|
||||
var totalTime = endTime - startTime;
|
||||
|
||||
Reference in New Issue
Block a user