PDA

View Full Version : Create shadow view surrounding the shape.



Niamita
26th May 2011, 05:01
Hi
I create a shape through paint , now the problem is that i have to give shadow view arround this shape , how should do this.
I read that by using the class QGraphicsEffect i can create shadow view but how to do i am not understanding.
Give me some code example or anything else related to this.

Waiting for your quick reply.

high_flyer
26th May 2011, 10:47
Is the drop shadow supposed to be for QGraphicsItem s in a scene, or do you mean for widgets on top a top level windows, or for top level windows?

Niamita
26th May 2011, 10:54
i have to create 3d view around the shape drawn by paint , yes mean to drop shadow but this is not which i want.
Suggest me how to do this. I have six hexagon shape combined to each other , arround them i have to create the 3d view,

high_flyer
26th May 2011, 10:56
You didn't answer my question.

Niamita
26th May 2011, 11:15
I mean for the widget on window

i create shape on frame and that frame i apply on the window.

high_flyer
26th May 2011, 11:47
In that case QGraphicsEffect will not help you, since its only to be used on QGraphicsItem s, which live in a scene.
As long as you want to have the effect only for child widgets of a parent widget/window in your application, you could implement a custom widget which will "wrap" each widget you want to have the shadow effect for, and use semi transparent gradient or semi transparent image background on the wrapper widget to create the shadow.

Creating the shadow for top level windows, is a much more complected issue as you application has no information of anything out side it self.
In modern window managers, you can have the effect for all top level windows which is done by the window manager, not just for your application. in which case there is nothing you should do as a developer, but that is a different issue.