Is there an API in QML similar to setMask() API of Qt?
We want to make a particular region of a QML rectangle transparent.
In case of -QT- 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- Qt cpp file and use setMask() API on the rectangle, but will this be possible?
Well, QDeclarativeView is a QWidget after all - so you just might give it a try.
QDeclarativeView is derived from QObject and setMask property is of QWidget so we can not use setMask for QDeclarativeView. can any one please suggest some way of masking in QML.
QDeclarativeView is a QGraphicsView is a QAbstractScrollArea is a QFrame is a QWidget (is a QObject).
Oh!!! that's right, so i have to pass the base Rectangle from QML application to QT CPP application and then Type cast it to QWidget and then call setMask on it, is it the right way?
It is worth pointing out that meego has this feature built in:
And even if you are on a different platform, you can just grab the source code from here:
In Qt Quick 2, you could use a shader to achieve the same thing.