I have struggle with animation. It works first time to increase width but with else statements it doesnt' decrease size.
def slideLeftMenu(self):
self.animation=QPropertyAnimation(self.ui.LeftMenuContainer,b'minimumWidth')
self.animation.setDuration(250)
width=self.ui.LeftMenuContainer.width()
if width==50:
self.ui.mainBodyContainer.move(100,0)
self.animation.setStartValue(50)
self.animation.setEndValue(100)
self.animation.start()
else:
self.ui.mainBodyContainer.move(50,0)
self.animation.setStartValue(100)
self.animation.setEndValue(50)
self.animation.setEasingCurve(QtCore.QEasingCurve.Type.InOutQuart)
self.animation.start()