Exemple #1
0
 def setEndValue(self, endValue):
     """wrapper with debugging code"""
     uiTile = self.targetObject()
     if uiTile.tile in Debug.animation:
         pName = self.pName()
         logDebug(
             u'%s: change endValue for %s: %s->%s  %s' % (self.ident(), pName, self.formatValue(self.endValue()),
                                                          self.formatValue(endValue), uiTile))
     QPropertyAnimation.setEndValue(self, endValue)
Exemple #2
0
 def setEndValue(self, endValue):
     """wrapper with debugging code"""
     graphicsObject = self.targetObject()
     if not isAlive(graphicsObject):
         # may happen when aborting a game because animations are cancelled first,
         # before the last move from server is executed
         return
     if graphicsObject.name() in Debug.animation or Debug.animation == 'all':
         pName = self.pName().decode()
         logDebug(
             '%s: change endValue for %s: %s->%s  %s' % (
                 self.ident(), pName,
                 self.formatValue(self.endValue()),
                 self.formatValue(endValue), graphicsObject))
     QPropertyAnimation.setEndValue(self, endValue)
Exemple #3
0
 def __init__(self, uiTile, propName, endValue, parent=None):
     pName = propName
     if isPython3 and usingQt5:
         # in this case they want bytes
         pName = pName.encode()
     QPropertyAnimation.__init__(self, uiTile, pName, parent)
     QPropertyAnimation.setEndValue(self, endValue)
     duration = Internal.Preferences.animationDuration()
     self.setDuration(duration)
     self.setEasingCurve(QEasingCurve.InOutQuad)
     uiTile.queuedAnimations.append(self)
     Animation.nextAnimations.append(self)
     if uiTile.tile in Debug.animation:
         oldAnimation = uiTile.activeAnimation.get(propName, None)
         if isAlive(oldAnimation):
             logDebug(
                 u'new animation %s (after %s is done)' %
                 (self, oldAnimation.ident()))
         else:
             logDebug(u'new animation %s' % self)
Exemple #4
0
 def __init__(self, graphicsObject, propName, endValue, parent=None):
     Animation.clsUid += 1
     self.uid = Animation.clsUid
     pName = propName
     QPropertyAnimation.__init__(self, graphicsObject, pName.encode(), parent)
     QPropertyAnimation.setEndValue(self, endValue)
     duration = Internal.Preferences.animationDuration()
     self.setDuration(duration)
     self.setEasingCurve(QEasingCurve.InOutQuad)
     graphicsObject.queuedAnimations.append(self)
     Animation.nextAnimations.append(self)
     self.debug = graphicsObject.name() in Debug.animation or Debug.animation == 'all'
     self.debug |= 'T{}t'.format(id4(graphicsObject)) in Debug.animation
     if self.debug:
         oldAnimation = graphicsObject.activeAnimation.get(propName, None)
         if isAlive(oldAnimation):
             logDebug(
                 'new Animation(%s) (after %s is done)' %
                 (self, oldAnimation.ident()))
         else:
             logDebug('Animation(%s)' % self)