Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.3.2
-
Mac OS X Yosemite (10.10)
Description
In the example below, you'll get log output whenever window area is clicked. That proves that onPaint handler is called even when Canvas is invisible. Expectation is that it is not.
import QtQuick 2.0 Rectangle { width: 800 height: 600 color: "seagreen" Canvas { id: canvas anchors.fill: parent visible: false onPaint: { console.log("visible:", visible) console.trace() var context = getContext("2d") context.save() context.fillStyle = "salmon" context.fillRect(0, 0, width, height) context.restore() } } MouseArea { anchors.fill: parent onPressed: canvas.requestPaint() } }
The same is true in case canvas.markDirty(Qt.rect(0, 0, canvas.width, canvas.height)) is used.