當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。