Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an API in QML similar to setMask() API of QT?

Tags:

qt

qml

We want to make a particular region of a QML rectangle transparent.

In case of QT, to do the same thing, we have used the setMask API of QWidget.

Is there any API in QML which does the same.

What I feel is that we can use the pass the QML rectangle to the QT cpp file and use setMask() API on the rectangle, but will this be possible?

Thanks, Abhijeet Shah

like image 681
ABS Avatar asked Nov 04 '22 12:11

ABS


1 Answers

I'm afraid the only way to do it at time is making your own QDeclarativeItem and using the C++ functions to add a mask to your Item.

Support to masking in plain QML Items was suggested to the QT developers and, as reported, will be released in QtQuick 2.0.

like image 148
TheHuge_ Avatar answered Nov 12 '22 17:11

TheHuge_