A sample highlighting QGraphicsEffect
English | فارسی
While learning Qt, I wrote this sample highlighting graphics effect to be used with rectangular QGraphicsPixmapItem.
..and I use this post just to learn how to publish a wiki page here too.. ;-)
The strange thing in the implementation is that the sourceIsPixmap() function returns always false, even if the documentation states that “Returns true if the source effectively is a pixmap, e.g., a QGraphicsPixmapItem.”
I ask to Qt gurus what can be going on here…
The default color is pale yellow, semi-transparent and the border size is set to 1.5. To add the effect simply add this:
Here the modified animated tiles example with the effect turned on:
Hope someone found this useful.