I found the problem!
Your mask object size must be same as source object.
See a sample:
@import QtQuick 2.1
import QtGraphicalEffects 1.0
Rectangle {
id: root
width: 600; height: 450
Rectangle {
id: sourceObj
anchors.fill: parent
Column {
anchors.centerIn: parent
rotation: -13
Text {
text: "Iran advancing science"
font { family: "Segoe UI Light"; pixelSize: 32 }
}
Text {
text: "Persia was a cradle of science in earlier times. "+"<br/>"+
"Persia contributed to the current understanding of nature, "+"<br/>"+
"medicine, mathematics, and philosophy. Persians made important "+"<br/>"+
"contributions to algebra and chemistry, invented the wind-power "+"<br/>"+
"machine, and the first distillation of alcohol. "
font { family: "Segoe UI Light"; pixelSize: 12 }
}
}
color: "skyblue"
visible: false
}
Rectangle {
id: maskObj
color: "transparent" //Notice! i want to mask only non-transparent area!
anchors.fill: sourceObj //Size must be same as sourceObj
Rectangle {
id: realMask //<----- This is my real mask
width: 313; height: 72
anchors.centerIn: parent
color: "red"
radius: 36
}
visible: false
}
OpacityMask {
id: myEffect
source: sourceObj
maskSource: maskObj
anchors.fill: parent
}
}
@
Good luck!