There is no component created by Qt that can do what you need. OpacityMaskclosest to what you need. You can view its code here in the official repository or on your computer along this path: Qt_folder / Qt_version / Qt_kit / qml / QtGraphicalEffects / OpacityMask. QML Thus, you can easily view the source of all QtGraphicalEffects components.
Use ShaderEffectis a good choice for the task.
As GrecKo pointed out, a property already exists invertin the object OpacityMask. It will be available from Qt 5.7, but the code is already available at the link above. You can either wait for the update, or download the component and use it in your project.
source
share