Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. Animated QGraphicsOpacityEffect widget is partially opaque until clicking on window
Qt 6.11 is out! See what's new in the release blog

Animated QGraphicsOpacityEffect widget is partially opaque until clicking on window

Scheduled Pinned Locked Moved Unsolved Language Bindings
python
1 Posts 1 Posters 715 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    patrickkidd
    wrote on last edited by A Former User
    #1

    I have a QGraphicsView (under QMainWindow) with a pop-up QWidget for item properties which fades in with QGraphicsOpacity effect. The problem is that when I start the animation the outer frame of the widget fades in as expected, but the contents of the widget remains transparent until I click somewhere on the window.

    Thoughts?

            self.effect = QGraphicsOpacityEffect(self)
            self.setGraphicsEffect(self.effect)
            self.opacityAnimation = QPropertyAnimation(self.effect, b'opacity')
            self.opacityAnimation.setDuration(300)
    	self.opacityAnimation.finished.connect(self.onOpacityDone)
    
        def show(self):
            super().show()
            self.opacityAnimation.setStartValue(0)
            self.opacityAnimation.setEndValue(1)
            self.opacityAnimation.start()
    
        def hide(self):
            self.person = None
            if self.opacityAnimation.finished():
                self.opacityAnimation.setStartValue(0)
                self.opacityAnimation.setEndValue(1)
                self.opacityAnimation.start()
            else:
                super().hide()
    
        def onOpacityDone(self):
            if self.opacityAnimation.currentValue() == 0:
                super().hide()
    

    https://alaskafamilysystems.com/

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved