Cut an inner region in a rectangle
Hello all,
I’m new in a developing with QML language and I’m stuck with a problem: I’ve 2 rectangles one inside another and I want the inner rectangle “cuts” the region it occupied from the outer rectangle. I need it because I’m using the outer rect as the border for the inner one, but inner color has an alpha channel part and as a result I have some undesirable color of the inner rect. Is there a way to accomplish the task?
I doesn’t use a border property because it overlaps with a rect inner space.
Thank in advance!
8 replies
No, I don’t wont to make holes :) But my inner rect is partly transparent and its color is blending with outer(border rect). I don’t want any blending here.
It would be exactly what I need if there were bitwise operations on images\rectangles, but I found none.
fcrochik, your solution is obviously reasonable but it is rather the workaround. If there is no other way then I’ll use it, but maybe there is?
bitwise operations into QML?
Could you give any more details about what you are looking for? Javascript (and thus QML) provides bitwise operators, but QML does not give access to raw pixel data for images, which might be what you are missing.
With the QML scene graph project, the focus is shifting to GL shaders for graphical manipulation of items — would something like that be helpful to you in this case?
Regards,
Michael
With the QML scene graph project, the focus is shifting to GL shaders for graphical manipulation of items — would something like that be helpful to you in this case?
I’d like to see something like Rectangle{ overlapMode: intersect\unite\exclude etc.} but maybe I’m missing something. It happens very often when studying new technology but continue to keep in mind an older one.
Now I’m going to use a four-part border and when I have more thorough knowledge in QML perhaps I’ll offer some suggestions
You must log in to post a reply. Not a member yet? Register here!





