I'm new to QML (on Android), so forgive me if this is a trivial thing. I am trying to use a Canvas object to draw some custom graphs, etc. However, I cannot get him to behave well with a change in screen orientation. If I start my application in portrait orientation, it looks fine until I switch to landscape. The same thing happens if I start his landscape. Everything is fine until I leave the portrait. How can I fix this behavior? Here is a simple test I'm having problems with:
import QtQuick 2.2
import QtQuick.Window 2.1
Window {
visible: true
visibility: Window.FullScreen
Rectangle {
anchors.fill: parent
color: "red"
Canvas {
anchors.fill: parent
onPaint: {
var ctx = getContext("2d")
ctx.fillStyle = "blue"
ctx.fillRect(0, 0, width, height)
}
}
}
}
. , , ( , ). , , .

. , ( . , ). , :
