My question is a follow up on this discussion.
Yes. Following way of grabToImage
can get me a snapshot of any particular QQuickItem
like parent_rect
below.
Rectangle {
id: parent_rect
width: 400
height: 400
Rectangle {
id: child_rect1
width: parent.width/4
height: parent.height/4
}
Rectangle {
id: child_rect2
width: parent.width/4
height: parent.height/4
}
}
// ...
parent_rect.grabToImage(function(result) {
result.saveToFile("something.png");
});
Problem:
But this grabToImage
gets me the snapshot of the all its children as well namely child_rect1
and child_rect2
.
Question:
How can I get the snapshot of parent_rect
only without getting its children add into the returned result?