本文整理匯總了Python中timeline.Timeline.drawTicker方法的典型用法代碼示例。如果您正苦於以下問題:Python Timeline.drawTicker方法的具體用法?Python Timeline.drawTicker怎麽用?Python Timeline.drawTicker使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類timeline.Timeline
的用法示例。
在下文中一共展示了Timeline.drawTicker方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Window
# 需要導入模塊: from timeline import Timeline [as 別名]
# 或者: from timeline.Timeline import drawTicker [as 別名]
class Window(QtGui.QMainWindow):
def __init__(self):
super(Window, self).__init__()
self.ctr = 0
self.timeline = Timeline()
self.signals_slots = signals_slots.Signal_Slots()
#timer for animation
#self.timer = QtCore.QTimer(self)
#self.connect(self.timer,
# QtCore.SIGNAL("timeout()"),
# self.update)
#self.timer.start(DELAY)
def setup_connections( self, ui ) :
ui.actionExit.triggered.connect(QtCore.QCoreApplication.instance().quit )
ui.actionOpen.triggered.connect(lambda: self.signals_slots.open_file(self, ui))
ui.playButton.clicked.connect(lambda: self.signals_slots.start_playback(self, ui))
ui.stopButton.clicked.connect(lambda: self.signals_slots.stop_playback(self, ui))
ui.seekSlider.setMediaObject(ui.videoPlayer.mediaObject())
ui.volumeSlider.setAudioOutput(ui.videoPlayer.audioOutput())
#ticker
ui.videoPlayer.mediaObject().tick.connect(self.tick)
def paintEvent(self, e):
print "paintEvent called"
start = {"x" : 170, "y" : 410 }
end = {"x" : 430, "y" : 500}
lines = { "short" : 5, "long" : 12 }
qp = QtGui.QPainter()
qp.begin(self)
self.timeline.drawRectangles(qp, start, end, lines)
self.timeline.drawLines(qp, start, end, lines)
self.timeline.drawTicker(qp, start, end, lines, self.ctr)
qp.end()
#def update( self) :
# print "something"
# self.ctr = self.ctr + 1
# print self.ctr
# self.repaint()
def tick(self, time):
displayTime = QtCore.QTime(0, (time / 60000) % 60, (time / 1000) % 60).second()
print displayTime * 10
self.ctr = displayTime * 10
self.repaint()