[Qt-interest] Is is possible to apply different graphics effect to child and parent

Sean Harmer sean.harmer at maps-technology.com
Wed Jan 13 12:18:28 CET 2010


Hi,

Andre Somers wrote:
> manish.s.sharma at nokia.com wrote:
>> Thanks for the reply.
>> Actually I don't want the COMBINED effects to take. Can we not set altogether different effects to the child items than the parent items?
>>
>> Regards,
>> Manish
>>
>>   
> I would break the parent-child relationship, and make them different 
> items that are layered on top of each other.

Only with the current architecture. There is precedent for this kind of 
disjoint/lack of children inheriting parental behaviour with the 
QGraphicsItem::ItemIgnoresParentOpacity flag. I guess what Manish is 
after woudl be an equivalent of this flag that applies to QGraphicsEffects.

Manish, I guess you could look at how the 
QGraphicsItem::ItemIgnoresParentOpacity flag is implemented and try to 
copy that for QGraphicsEffects.

Whilst I am at it what would also be nice to have is an API for setting 
a list of QGraphicsEffects on a single QGraphicsItem. At present it is 
only possible to set a single effect on an item which means that to 
apply several effects you have to either:

(a) Change the item hierarchy to introduce invisible parent group items 
and add a single effect to each of those.
(b) Write your own QGraphicsEffect class that combines several effects.

I know, I know that if I want it badly enough I could add the 
functionality myself but as always available time is the killer. :-)

> 
> André
> 
> P.S. Interesting to see that even within Nokia itself, people use this 
> list as a support channel. :-)

I was thinking the same thing. :-)

ATB,

Sean



More information about the Qt-interest-old mailing list