[Python] I made an effect that can dissolve widgets with QMovie, but I can't find a way to...

Discussão em 'Python' iniciado por Stack, Julho 3, 2025.

  1. Stack

    Stack Membro Participativo

    How the dissolve looks like if you want to dissolve the entire window: [​IMG]

    And if I apply it to a single widget like this:

    self.test_label = QLabel()
    self.test_label.setFixedSize(300, 300)
    self.test_label.setStyleSheet("background: red;")
    self.test_label.setParent(self.body)
    self.test_label.show()

    self.test_animation = QMovie(":/animations/triangle.gif")
    self.test_animation.start()

    self.blend_test = BlendEffect(self.test_animation)
    self.blend_test.setBlendMode(QPainter.CompositionMode.CompositionMode_Xor)
    self.test_label.setGraphicsEffect(self.blend_test)


    [​IMG]

    I want to dissolve the red label only, without affecting the widgets behind it. This would be useful for page transitions of QStackedWidget.

    The blend effect as well as an example application can be found at: https://github.com/dgsgsgdggg/BlendEffectExample

    Continue reading...

Compartilhe esta Página