Same Qgraphicseffect to different qgraphicsitems?
-
Hello all, I am trying to apply qgraphicsdropshadoweffect to QGraphicsTextItems, but the effect is being applied to only the last item, may I know why?
@
effect5->setBlurRadius(_shadowData.blurRadius);
effect5->setXOffset(_shadowData.hOffset);
effect5->setYOffset(_shadowData.vOffset);
effect5->setColor(_shadowData.shadowColor);text1->setGraphicsEffect(effect5); text2->setGraphicsEffect(effect5); text3->setGraphicsEffect(effect5); text5->setGraphicsEffect(effect5); text4->setGraphicsEffect(effect5);
@
-
You have to create a new QGraphicsEffect object for each object that you are using.
-
If effect is the installed on a different item, setGraphicsEffect() will remove the effect from the item and install it on this item.
-
reading the "docs":http://qt-project.org/doc/qt-4.8/qgraphicsitem.html#setGraphicsEffect really may help!