当前位置: 首页>>代码示例>>Python>>正文


Python Timeline.drawLines方法代码示例

本文整理汇总了Python中timeline.Timeline.drawLines方法的典型用法代码示例。如果您正苦于以下问题:Python Timeline.drawLines方法的具体用法?Python Timeline.drawLines怎么用?Python Timeline.drawLines使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在timeline.Timeline的用法示例。


在下文中一共展示了Timeline.drawLines方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Window

# 需要导入模块: from timeline import Timeline [as 别名]
# 或者: from timeline.Timeline import drawLines [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()
开发者ID:alidzapp,项目名称:videoVenom,代码行数:59,代码来源:window.py


注:本文中的timeline.Timeline.drawLines方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。