本文整理汇总了Python中demoitemanimation.DemoItemAnimation.hideOnFinished方法的典型用法代码示例。如果您正苦于以下问题:Python DemoItemAnimation.hideOnFinished方法的具体用法?Python DemoItemAnimation.hideOnFinished怎么用?Python DemoItemAnimation.hideOnFinished使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类demoitemanimation.DemoItemAnimation
的用法示例。
在下文中一共展示了DemoItemAnimation.hideOnFinished方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createTicker
# 需要导入模块: from demoitemanimation import DemoItemAnimation [as 别名]
# 或者: from demoitemanimation.DemoItemAnimation import hideOnFinished [as 别名]
def createTicker(self):
if Colors.noTicker:
return
movie_in = self.score.insertMovie('ticker')
movie_out = self.score.insertMovie('ticker -out')
movie_activate = self.score.insertMovie('ticker -activate')
movie_deactivate = self.score.insertMovie('ticker -deactivate')
self.ticker = ItemCircleAnimation(self.window.scene)
self.ticker.setZValue(50)
self.ticker.hide()
# Move ticker in.
qtendpos = 485
qtPosY = 120
self.tickerInAnim = DemoItemAnimation(self.ticker,
DemoItemAnimation.ANIM_IN)
self.tickerInAnim.setDuration(500)
self.tickerInAnim.setStartPos(QtCore.QPointF(self.window.scene.sceneRect().width(), Colors.contentStartY + qtPosY))
self.tickerInAnim.setPosAt(0.60, QtCore.QPointF(qtendpos, Colors.contentStartY + qtPosY))
self.tickerInAnim.setPosAt(0.70, QtCore.QPointF(qtendpos + 30, Colors.contentStartY + qtPosY))
self.tickerInAnim.setPosAt(0.80, QtCore.QPointF(qtendpos, Colors.contentStartY + qtPosY))
self.tickerInAnim.setPosAt(0.90, QtCore.QPointF(qtendpos + 5, Colors.contentStartY + qtPosY))
self.tickerInAnim.setPosAt(1.00, QtCore.QPointF(qtendpos, Colors.contentStartY + qtPosY))
movie_in.append(self.tickerInAnim)
# Move ticker out.
qtOut = DemoItemAnimation(self.ticker, DemoItemAnimation.ANIM_OUT)
qtOut.hideOnFinished = True
qtOut.setDuration(500)
qtOut.setStartPos(QtCore.QPointF(qtendpos, Colors.contentStartY + qtPosY))
qtOut.setPosAt(1.00, QtCore.QPointF(self.window.scene.sceneRect().width() + 700, Colors.contentStartY + qtPosY))
movie_out.append(qtOut)
# Move ticker in on activate.
qtActivate = DemoItemAnimation(self.ticker)
qtActivate.setDuration(400)
qtActivate.setStartPos(QtCore.QPointF(self.window.scene.sceneRect().width(), Colors.contentStartY + qtPosY))
qtActivate.setPosAt(0.60, QtCore.QPointF(qtendpos, Colors.contentStartY + qtPosY))
qtActivate.setPosAt(0.70, QtCore.QPointF(qtendpos + 30, Colors.contentStartY + qtPosY))
qtActivate.setPosAt(0.80, QtCore.QPointF(qtendpos, Colors.contentStartY + qtPosY))
qtActivate.setPosAt(0.90, QtCore.QPointF(qtendpos + 5, Colors.contentStartY + qtPosY))
qtActivate.setPosAt(1.00, QtCore.QPointF(qtendpos, Colors.contentStartY + qtPosY))
movie_activate.append(qtActivate)
# Move ticker out on deactivate.
qtDeactivate = DemoItemAnimation(self.ticker)
qtDeactivate.hideOnFinished = True
qtDeactivate.setDuration(400)
qtDeactivate.setStartPos(QtCore.QPointF(qtendpos, Colors.contentStartY + qtPosY))
qtDeactivate.setPosAt(1.00, QtCore.QPointF(qtendpos, 800))
movie_deactivate.append(qtDeactivate)
示例2: createInfo
# 需要导入模块: from demoitemanimation import DemoItemAnimation [as 别名]
# 或者: from demoitemanimation.DemoItemAnimation import hideOnFinished [as 别名]
def createInfo(self, item, name):
movie_in = self.score.insertMovie(name)
movie_out = self.score.insertMovie(name + ' -out')
item.setZValue(8)
item.setRecursiveVisible(False)
xOffset = 230.0
infoIn = DemoItemAnimation(item, DemoItemAnimation.ANIM_IN)
infoIn.timeline.setCurveShape(QtCore.QTimeLine.LinearCurve)
infoIn.setDuration(650)
infoIn.setStartPos(QtCore.QPointF(self.window.scene.sceneRect().width(), Colors.contentStartY))
infoIn.setPosAt(0.60, QtCore.QPointF(xOffset, Colors.contentStartY))
infoIn.setPosAt(0.70, QtCore.QPointF(xOffset + 20, Colors.contentStartY))
infoIn.setPosAt(0.80, QtCore.QPointF(xOffset, Colors.contentStartY))
infoIn.setPosAt(0.90, QtCore.QPointF(xOffset + 7, Colors.contentStartY))
infoIn.setPosAt(1.00, QtCore.QPointF(xOffset, Colors.contentStartY))
movie_in.append(infoIn)
infoOut = DemoItemAnimation(item, DemoItemAnimation.ANIM_OUT)
infoOut.timeline.setCurveShape(QtCore.QTimeLine.EaseInCurve)
infoOut.setDuration(300)
infoOut.hideOnFinished = True
infoOut.setStartPos(QtCore.QPointF(xOffset, Colors.contentStartY))
infoOut.setPosAt(1.0, QtCore.QPointF(-600, Colors.contentStartY))
movie_out.append(infoOut)
示例3: createLowRightLeafButton
# 需要导入模块: from demoitemanimation import DemoItemAnimation [as 别名]
# 或者: from demoitemanimation.DemoItemAnimation import hideOnFinished [as 别名]
def createLowRightLeafButton(self, label, xOffset, type, movieIn, movieOut, movieShake):
item = TextButton(label, TextButton.RIGHT, type, self.window.scene,
self.window.mainSceneRoot, TextButton.PANEL)
item.setRecursiveVisible(False)
item.setZValue(10)
sw = self.window.scene.sceneRect().width()
sh = self.window.scene.sceneRect().height()
# Create in-animation.
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_IN)
anim.setDuration(1050 * Colors.animSpeedButtons)
anim.setStartPos(QtCore.QPointF(sw, Colors.contentStartY + Colors.contentHeight - 35))
anim.setPosAt(0.10, QtCore.QPointF(sw, Colors.contentStartY + Colors.contentHeight - 35))
anim.setPosAt(0.30, QtCore.QPointF(xOffset, Colors.contentStartY + Colors.contentHeight - 35))
anim.setPosAt(0.35, QtCore.QPointF(xOffset + 30, Colors.contentStartY + Colors.contentHeight - 35))
anim.setPosAt(0.40, QtCore.QPointF(xOffset, Colors.contentStartY + Colors.contentHeight - 35))
anim.setPosAt(0.45, QtCore.QPointF(xOffset + 5, Colors.contentStartY + Colors.contentHeight - 35))
anim.setPosAt(0.50, QtCore.QPointF(xOffset, Colors.contentStartY + Colors.contentHeight - 35))
anim.setPosAt(1.00, QtCore.QPointF(xOffset, Colors.contentStartY + Colors.contentHeight - 26))
movieIn.append(anim)
# Create out-animation.
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_OUT)
anim.hideOnFinished = True
anim.setDuration(300 * Colors.animSpeedButtons)
anim.setStartPos(QtCore.QPointF(xOffset, Colors.contentStartY + Colors.contentHeight - 26))
anim.setPosAt(1.0, QtCore.QPointF(xOffset, sh))
movieOut.append(anim)
示例4: createLowLeftButton
# 需要导入模块: from demoitemanimation import DemoItemAnimation [as 别名]
# 或者: from demoitemanimation.DemoItemAnimation import hideOnFinished [as 别名]
def createLowLeftButton(self, label, type, movieIn, movieOut, movieShake, menuString=""):
button = TextButton(label, TextButton.RIGHT, type, self.window.scene,
self.window.mainSceneRoot, TextButton.PANEL)
if menuString:
button.setMenuString(menuString)
button.setRecursiveVisible(False)
button.setZValue(10)
iw = button.sceneBoundingRect().width()
xOffset = 15
# Create in-animation.
buttonIn = DemoItemAnimation(button, DemoItemAnimation.ANIM_IN)
buttonIn.setDuration(1800 * Colors.animSpeedButtons)
buttonIn.setStartPos(QtCore.QPointF(-iw, Colors.contentStartY + Colors.contentHeight - 35))
buttonIn.setPosAt(0.5, QtCore.QPointF(-iw, Colors.contentStartY + Colors.contentHeight - 35))
buttonIn.setPosAt(0.7, QtCore.QPointF(xOffset, Colors.contentStartY + Colors.contentHeight - 35))
buttonIn.setPosAt(1.0, QtCore.QPointF(xOffset, Colors.contentStartY + Colors.contentHeight - 26))
movieIn.append(buttonIn)
# Create out-animation.
buttonOut = DemoItemAnimation(button, DemoItemAnimation.ANIM_OUT)
buttonOut.hideOnFinished = True
buttonOut.setDuration(400 * Colors.animSpeedButtons)
buttonOut.setStartPos(QtCore.QPointF(xOffset, Colors.contentStartY + Colors.contentHeight - 26))
buttonOut.setPosAt(1.0, QtCore.QPointF(-iw, Colors.contentStartY + Colors.contentHeight - 26))
movieOut.append(buttonOut)
if movieShake is not None:
shakeAnim = DemoItemAnimation(button, DemoItemAnimation.ANIM_UNSPECIFIED)
shakeAnim.timeline.setCurveShape(QtCore.QTimeLine.LinearCurve)
shakeAnim.setDuration(650)
shakeAnim.setStartPos(buttonIn.posAt(1.0))
shakeAnim.setPosAt(0.60, buttonIn.posAt(1.0))
shakeAnim.setPosAt(0.70, buttonIn.posAt(1.0) + QtCore.QPointF(-3, 0))
shakeAnim.setPosAt(0.80, buttonIn.posAt(1.0) + QtCore.QPointF(2, 0))
shakeAnim.setPosAt(0.90, buttonIn.posAt(1.0) + QtCore.QPointF(-1, 0))
shakeAnim.setPosAt(1.00, buttonIn.posAt(1.0))
movieShake.append(shakeAnim)
示例5: createMenu
# 需要导入模块: from demoitemanimation import DemoItemAnimation [as 别名]
# 或者: from demoitemanimation.DemoItemAnimation import hideOnFinished [as 别名]
def createMenu(self, category, type):
sw = self.window.scene.sceneRect().width()
xOffset = 15
yOffset = 10
maxExamples = Colors.menuCount
menuIndex = 1
name = str(category.attribute('name'))
currentNode = category.firstChild()
currentMenu = '%s -menu%d' % (name, menuIndex)
while not currentNode.isNull():
movieIn = self.score.insertMovie(currentMenu)
movieOut = self.score.insertMovie(currentMenu + ' -out')
movieNextTopOut = self.score.insertMovie(currentMenu + ' -top_out')
movieNextBottomOut = self.score.insertMovie(currentMenu + ' -bottom_out')
movieNextTopIn = self.score.insertMovie(currentMenu + ' -top_in')
movieNextBottomIn = self.score.insertMovie(currentMenu + ' -bottom_in')
movieShake = self.score.insertMovie(currentMenu + ' -shake')
i = 0
while not currentNode.isNull() and i < maxExamples:
# Create a normal menu button.
label = str(currentNode.toElement().attribute('name'))
item = TextButton(label, TextButton.LEFT, type,
self.window.scene, self.window.mainSceneRoot)
currentNode = currentNode.nextSibling()
# Skip the OpenGL examples if they can't run.
if str(currentNode.toElement().attribute('dirname')) == 'opengl':
if not Colors.openGlAvailable:
currentNode = currentNode.nextSibling()
item.setRecursiveVisible(False)
item.setZValue(10)
ih = item.sceneBoundingRect().height()
iw = item.sceneBoundingRect().width()
ihp = ih + 3
# Create in-animation.
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_IN)
anim.setDuration(float(1000 + (i * 20)) * Colors.animSpeedButtons)
anim.setStartPos(QtCore.QPointF(xOffset, -ih))
anim.setPosAt(0.20, QtCore.QPointF(xOffset, -ih))
anim.setPosAt(0.50, QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY + (10 * float(i / 4.0))))
anim.setPosAt(0.60, QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
anim.setPosAt(0.70, QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY + (5 * float(i / 4.0))))
anim.setPosAt(0.80, QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
anim.setPosAt(0.90, QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY + (2 * float(i / 4.0))))
anim.setPosAt(1.00, QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
movieIn.append(anim)
# Create out-animation.
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_OUT)
anim.hideOnFinished = True
anim.setDuration((700 + (30 * i)) * Colors.animSpeedButtons)
anim.setStartPos(QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
anim.setPosAt(0.60, QtCore.QPointF(xOffset, 600 - ih - ih))
anim.setPosAt(0.65, QtCore.QPointF(xOffset + 20, 600 - ih))
anim.setPosAt(1.00, QtCore.QPointF(sw + iw, 600 - ih))
movieOut.append(anim)
# Create shake-animation.
anim = DemoItemAnimation(item)
anim.setDuration(700 * Colors.animSpeedButtons)
anim.setStartPos(QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
anim.setPosAt(0.55, QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY - i*2.0))
anim.setPosAt(0.70, QtCore.QPointF(xOffset - 10, (i * ihp) + yOffset + Colors.contentStartY - i*1.5))
anim.setPosAt(0.80, QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY - i*1.0))
anim.setPosAt(0.90, QtCore.QPointF(xOffset - 2, (i * ihp) + yOffset + Colors.contentStartY - i*0.5))
anim.setPosAt(1.00, QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
movieShake.append(anim)
# Create next-menu top-out-animation.
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_OUT)
anim.hideOnFinished = True
anim.setDuration((200 + (30 * i)) * Colors.animSpeedButtons)
anim.setStartPos(QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
anim.setPosAt(0.70, QtCore.QPointF(xOffset, yOffset + Colors.contentStartY))
anim.setPosAt(1.00, QtCore.QPointF(-iw, yOffset + Colors.contentStartY))
movieNextTopOut.append(anim)
# Create next-menu bottom-out-animation.
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_OUT)
anim.hideOnFinished = True
anim.setDuration((200 + (30 * i)) * Colors.animSpeedButtons)
anim.setStartPos(QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
anim.setPosAt(0.70, QtCore.QPointF(xOffset, (maxExamples * ihp) + yOffset + Colors.contentStartY))
anim.setPosAt(1.00, QtCore.QPointF(-iw, (maxExamples * ihp) + yOffset + Colors.contentStartY))
movieNextBottomOut.append(anim)
# Create next-menu top-in-animation.
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_IN)
anim.setDuration((700 - (30 * i)) * Colors.animSpeedButtons)
anim.setStartPos(QtCore.QPointF(-iw, yOffset + Colors.contentStartY))
anim.setPosAt(0.30, QtCore.QPointF(xOffset, yOffset + Colors.contentStartY))
anim.setPosAt(1.00, QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
movieNextTopIn.append(anim)
# Create next-menu bottom-in-animation.
reverse = maxExamples - i
#.........这里部分代码省略.........