I have been trying to create a basic QGraphicsEffect to change the colors of the widget, but first I tried to make an effect that does nothing like so:
class QGraphicsSepiaEffect(QtWidgets.QGraphicsEffect):
def draw(painter):
pixmap = sourcePixmap()
painter.drawPixmap(pixmap.rect(), pixmap)
I am using PySide2. Though I checked all over the internet but couldn't find any sample, neither a template nor a real custom effect.
How can I write a basic effect to alter the colors of my widget?
As your question is basically how to create a custom effect then based on an example offered by the Qt community I have translated it to PySide2: