<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # QTimeLine Class Reference ## [[QtCore](index.htm) module] 該QTimeLine類提供了一個時間表來控制動畫。[More...](#details) 繼承[QObject](qobject.html)。 ### Types * `enum CurveShape { EaseInCurve, EaseOutCurve, EaseInOutCurve, LinearCurve, SineCurve, CosineCurve }` * `enum Direction { Forward, Backward }` * `enum State { NotRunning, Paused, Running }` ### Methods * `__init__ (self, int?duration?=?1000, QObject?parent?=?None)` * `int currentFrame (self)` * `int currentTime (self)` * `float currentValue (self)` * `CurveShape curveShape (self)` * `Direction direction (self)` * `int duration (self)` * `QEasingCurve easingCurve (self)` * `int endFrame (self)` * `int frameForTime (self, int?msec)` * `int loopCount (self)` * `resume (self)` * `setCurrentTime (self, int?msec)` * `setCurveShape (self, CurveShape?shape)` * `setDirection (self, Direction?direction)` * `setDuration (self, int?duration)` * `setEasingCurve (self, QEasingCurve?curve)` * `setEndFrame (self, int?frame)` * `setFrameRange (self, int?startFrame, int?endFrame)` * `setLoopCount (self, int?count)` * `setPaused (self, bool?paused)` * `setStartFrame (self, int?frame)` * `setUpdateInterval (self, int?interval)` * `start (self)` * `int startFrame (self)` * `State state (self)` * `stop (self)` * `timerEvent (self, QTimerEvent?event)` * `toggleDirection (self)` * `int updateInterval (self)` * `float valueForTime (self, int?msec)` ### Qt Signals * `void finished ()` * `void frameChanged (int)` * `void stateChanged (QTimeLine::State)` * `void valueChanged (qreal)` * * * ## Detailed Description 該QTimeLine類提供了一個時間表來控制動畫。 這是最常用的定期調用插槽,一個動畫圖形用戶界面控制。你可以通過傳遞它的持續時間以毫秒為單位QTimeLine的構造函數構造一個時間表。時間線的持續時間描述了多久動畫將運行。然后,通過調用設置一個合適的框架范圍[setFrameRange](qtimeline.html#setFrameRange)( ) 。最后連接[frameChanged](qtimeline.html#frameChanged)()信號到一個合適的插槽,你想在動畫(例如, setValue方法( )的小工具[QProgressBar](qprogressbar.html)) 。當您進行呼叫[start](qtimeline.html#start)( ) , QTimeLine將進入運行狀態,并開始發光[frameChanged](qtimeline.html#frameChanged)( )定期,造成你的widget的連接屬性的值從低端長到你的框架范圍的上限,并以穩定的速度。你可以通過調用指定的更新間隔[setUpdateInterval](qtimeline.html#updateInterval-prop)( ) 。完成后, QTimeLine進入[NotRunning](qtimeline.html#State-enum)態,并發射[finished](qtimeline.html#finished)( ) 。 例如: ``` ... progressBar = new [QProgressBar](qprogressbar.html)(this); progressBar->setRange(0, 100); // Construct a 1-second timeline with a frame range of 0 - 100 QTimeLine *timeLine = new QTimeLine(1000, this); timeLine->setFrameRange(0, 100); connect(timeLine, SIGNAL(frameChanged(int)), progressBar, SLOT(setValue(int))); // Clicking the push button will start the progress bar animation pushButton = new [QPushButton](qpushbutton.html)(tr("Start animation"), this); connect(pushButton, SIGNAL(clicked()), timeLine, SLOT(start())); ... ``` 您還可以使用QTimeLine與[Graphics View framework](index.htm#graphics-view)為動畫。該[QGraphicsItemAnimation](qgraphicsitemanimation.html)類實現的動畫[QGraphicsItems](qgraphicsitem.html)有一個時間表。 默認情況下,時間線運行一次,從一開始接近尾聲,在這你必須調用[start](qtimeline.html#start)()再次從開始重新啟動。若要使時間循環,可以調用[setLoopCount](qtimeline.html#loopCount-prop)( ) ,傳遞時代的時間表應該在完成之前運行的次數。方向也可以改變,導致在時間軸向后運行,通過調用[setDirection](qtimeline.html#direction-prop)( ) 。您也可以暫停及恢復的時間線,而它的運行通過調用[setPaused](qtimeline.html#setPaused)( ) 。對于交互式的控制,[setCurrentTime](qtimeline.html#currentTime-prop)()函數被提供,其直接設置時間線的時間位置。雖然最有用[NotRunning](qtimeline.html#State-enum)狀態(例如,連接到一個[valueChanged](qtimeline.html#valueChanged)()中的信號[QSlider](qslider.html),),該函數可以在任何時候調用。 在框架接口是標準的部件有用的,但QTimeLine可用于控制任何類型的動畫。 QTimeLine的心臟在于[valueForTime](qtimeline.html#valueForTime)( )函數,它產生一個_value_0和1之間一個給定的時間。這個值通常是用來描述一個動畫,其中0是動畫的第一步驟,和1是最后一步的步驟。在運行時, QTimeLine通過調用生成0和1之間的值[valueForTime](qtimeline.html#valueForTime)()和發射[valueChanged](qtimeline.html#valueChanged)( ) 。默認情況下,[valueForTime](qtimeline.html#valueForTime)( )適用的插值算法來生成這些值。您可以從一組預定義的時間線算法通過調用選擇[setCurveShape](qtimeline.html#curveShape-prop)( ) 。 請注意,默認情況下, QTimeLine使用EaseInOut曲線形狀,它提供了一個值,生長緩慢,然后穩步增長,終于慢慢地成長。對于自定義的時間軸,你可以重新實現[valueForTime](qtimeline.html#valueForTime)() ,在這種情況QTimeLine的[curveShape](qtimeline.html#curveShape-prop)屬性被忽略。 * * * ## Type Documentation ``` QTimeLine.CurveShape ``` 這個枚舉變量描述的默認形狀[QTimeLine](qtimeline.html)的價值曲線。默認的,形狀是EaseInOutCurve 。該曲線定義的值,并在時間軸之間的關系。 | Constant | Value | Description | | --- | --- | --- | | `QTimeLine.EaseInCurve` | `0` | 該值開始緩慢增長,然后在速度增加。 | | `QTimeLine.EaseOutCurve` | `1` | 該值開始穩步增長,然后慢慢結束。 | | `QTimeLine.EaseInOutCurve` | `2` | 該值開始緩慢增長,然后穩步運行,然后再次生長緩慢。 | | `QTimeLine.LinearCurve` | `3` | 該值線性增長(例如,如果持續時間為1000毫秒,在時間的價值500毫秒為0.5 ) 。 | | `QTimeLine.SineCurve` | `4` | 價值增長正弦。 | | `QTimeLine.CosineCurve` | `5` | 價值增長cosinusoidally 。 | **See also** [setCurveShape](qtimeline.html#curveShape-prop)( ) 。 ``` QTimeLine.Direction ``` 這個枚舉變量描述時間軸的方向時,[Running](qtimeline.html#State-enum)狀態。 | Constant | Value | Description | | --- | --- | --- | | `QTimeLine.Forward` | `0` | 時間軸的當前時間隨時間(即從0到接近尾聲/時間移動) 。 | | `QTimeLine.Backward` | `1` | 隨著時間(即從底/持續時間和對0移動)時間軸的當前時間減少。 | **See also** [setDirection](qtimeline.html#direction-prop)( ) 。 ``` QTimeLine.State ``` 這個枚舉變量描述時間軸的狀態。 | Constant | Value | Description | | --- | --- | --- | | `QTimeLine.NotRunning` | `0` | 時間軸沒有運行。這是初始狀態[QTimeLine](qtimeline.html),和國家[QTimeLine](qtimeline.html)重新進入時完成。當前的時間,框架和價值保持不變,直至[setCurrentTime](qtimeline.html#currentTime-prop)( )被調用時,或者時間線是通過調用啟動[start](qtimeline.html#start)( ) 。 | | `QTimeLine.Paused` | `1` | 時間軸暫停(即暫停) 。調用setPaused (假)將恢復時間表活動。 | | `QTimeLine.Running` | `2` | 時間線運行。而控制是在事件循環,[QTimeLine](qtimeline.html)將定期更新其當前的時間,發光[valueChanged](qtimeline.html#valueChanged)()和[frameChanged](qtimeline.html#frameChanged)( )在適當的時候。 | **See also** [state](qtimeline.html#state)()和[stateChanged](qtimeline.html#stateChanged)( ) 。 * * * ## Method Documentation ``` QTimeLine.__init__ (self, int?duration?=?1000, QObject?parent?=?None) ``` 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 構造一個帶有時間線的持續時間_duration_毫秒。_parent_被傳遞給[QObject](qobject.html)的構造。默認持續時間為1000毫秒。 ``` int QTimeLine.currentFrame (self) ``` 返回對應于當前的時間框架。 **See also** [currentTime](qtimeline.html#currentTime-prop)( )[frameForTime](qtimeline.html#frameForTime)()和[setFrameRange](qtimeline.html#setFrameRange)( ) 。 ``` int QTimeLine.currentTime (self) ``` ``` float QTimeLine.currentValue (self) ``` 返回對應于當前時間的值。 **See also** [valueForTime](qtimeline.html#valueForTime)()和[currentFrame](qtimeline.html#currentFrame)( ) 。 ``` CurveShape QTimeLine.curveShape (self) ``` [](qtimeline.html#CurveShape-enum) ``` Direction QTimeLine.direction (self) ``` [ ``` int QTimeLine.duration (self) ``` ](qtimeline.html#Direction-enum) ``` QEasingCurve QTimeLine.easingCurve (self) ``` [ ``` int QTimeLine.endFrame (self) ``` 返回端框架,它是對應于時間線(即對于其當前值是1幀)的端部的框架。 ](qeasingcurve.html) [**See also**](qeasingcurve.html) [setEndFrame](qtimeline.html#setEndFrame)()和[setFrameRange](qtimeline.html#setFrameRange)( ) 。 ``` int QTimeLine.frameForTime (self, int?msec) ``` 返回對應于時間幀_msec_。此值是使用的開始和結束幀的線性插值,基于由返回的值計算出[valueForTime](qtimeline.html#valueForTime)( ) 。 **See also** [valueForTime](qtimeline.html#valueForTime)()和[setFrameRange](qtimeline.html#setFrameRange)( ) 。 ``` int QTimeLine.loopCount (self) ``` ``` QTimeLine.resume (self) ``` 這種方法也是一個Qt槽與C + +的簽名`void resume()`。 從當前時間恢復的時間表。[QTimeLine](qtimeline.html)將重新進入運行狀態,一旦進入事件循環,它會更新其當前的時間,框架和價值定期進行。 在對比[start](qtimeline.html#start)( ) ,這個函數不重新啟動的時間線將恢復之前。 **See also** [start](qtimeline.html#start)( )[updateInterval](qtimeline.html#updateInterval-prop)( )[frameChanged](qtimeline.html#frameChanged)()和[valueChanged](qtimeline.html#valueChanged)( ) 。 ``` QTimeLine.setCurrentTime (self, int?msec) ``` 這種方法也是一個Qt槽與C + +的簽名`void setCurrentTime(int)`。 ``` QTimeLine.setCurveShape (self, CurveShape?shape) ``` ``` QTimeLine.setDirection (self, Direction?direction) ``` ``` QTimeLine.setDuration (self, int?duration) ``` ``` QTimeLine.setEasingCurve (self, QEasingCurve?curve) ``` ``` QTimeLine.setEndFrame (self, int?frame) ``` 設置結束幀,這是對應于時間線(即對于其當前值是1幀)的端部的框架,以_frame_。 **See also** [endFrame](qtimeline.html#endFrame)( )[startFrame](qtimeline.html#startFrame)()和[setFrameRange](qtimeline.html#setFrameRange)( ) 。 ``` QTimeLine.setFrameRange (self, int?startFrame, int?endFrame) ``` 設置時間軸的幀計數器開始在_startFrame_以及端部和_endFrame_。對于每個時間值,[QTimeLine](qtimeline.html)將找到相應的幀,當你調用[currentFrame](qtimeline.html#currentFrame)()或[frameForTime](qtimeline.html#frameForTime)()通過內插,使用的返回值[valueForTime](qtimeline.html#valueForTime)( ) 。 當在運行狀態下,[QTimeLine](qtimeline.html)還發出了[frameChanged](qtimeline.html#frameChanged)( )信號時,幀的變化。 **See also** [startFrame](qtimeline.html#startFrame)( )[endFrame](qtimeline.html#endFrame)( )[start](qtimeline.html#start)()和[currentFrame](qtimeline.html#currentFrame)( ) 。 ``` QTimeLine.setLoopCount (self, int?count) ``` ``` QTimeLine.setPaused (self, bool?paused) ``` 這種方法也是一個Qt槽與C + +的簽名`void setPaused(bool)`。 If _paused_誠然,在時間軸暫停,造成[QTimeLine](qtimeline.html)進入暫停狀態。沒有更新將被通知,直至[start](qtimeline.html#start)()或setPaused (假)被調用。如果_paused_是假的,時間軸恢復并繼續它。 **See also** [state](qtimeline.html#state)()和[start](qtimeline.html#start)( ) 。 ``` QTimeLine.setStartFrame (self, int?frame) ``` 設置開始幀,這是對應于時間線(即對于該電流值是0幀)的開始,到該幀_frame_。 **See also** [startFrame](qtimeline.html#startFrame)( )[endFrame](qtimeline.html#endFrame)()和[setFrameRange](qtimeline.html#setFrameRange)( ) 。 ``` QTimeLine.setUpdateInterval (self, int?interval) ``` ``` QTimeLine.start (self) ``` 這種方法也是一個Qt槽與C + +的簽名`void start()`。 啟動時間表。[QTimeLine](qtimeline.html)將進入運行狀態,一旦進入事件循環,它會更新其當前的時間,框架和價值定期進行。默認時間間隔為40毫秒(即每秒25次) 。你可以通過調用更改更新時間間隔[setUpdateInterval](qtimeline.html#updateInterval-prop)( ) 。 時間軸會從位置0 ,或結束時,如果倒退啟動。如果你想恢復已停止的時間表而不需要重新啟動,你可以調用[resume](qtimeline.html#resume)( )來代替。 **See also** [resume](qtimeline.html#resume)( )[updateInterval](qtimeline.html#updateInterval-prop)( )[frameChanged](qtimeline.html#frameChanged)()和[valueChanged](qtimeline.html#valueChanged)( ) 。 ``` int QTimeLine.startFrame (self) ``` 返回的起始幀,這是對應于時間線(即對于其當前值是0幀)的開始幀。 **See also** [setStartFrame](qtimeline.html#setStartFrame)()和[setFrameRange](qtimeline.html#setFrameRange)( ) 。 ``` State QTimeLine.state (self) ``` [ 返回時間軸的狀態。 ](qtimeline.html#State-enum) [**See also**](qtimeline.html#State-enum) [start](qtimeline.html#start)( )[setPaused](qtimeline.html#setPaused)()和[stop](qtimeline.html#stop)( ) 。 ``` QTimeLine.stop (self) ``` 這種方法也是一個Qt槽與C + +的簽名`void stop()`。 停止時間軸,造成[QTimeLine](qtimeline.html) to enter [NotRunning](qtimeline.html#State-enum)狀態。 **See also** [start](qtimeline.html#start)( ) 。 ``` QTimeLine.timerEvent (self, QTimerEvent?event) ``` 從重新實現[QObject.timerEvent](qobject.html#timerEvent)( ) 。 ``` QTimeLine.toggleDirection (self) ``` 這種方法也是一個Qt槽與C + +的簽名`void toggleDirection()`。 切換時間線的方向。如果方向是前進,它變得落后,副verca 。 **See also** [setDirection](qtimeline.html#direction-prop)( ) 。 ``` int QTimeLine.updateInterval (self) ``` ``` float QTimeLine.valueForTime (self, int?msec) ``` 返回時間軸價值的時間_msec_。返回的值,取決于曲線的形狀而變化,始終為0和1之間。如果_msec_為0時,默認的實現始終返回0 。 重新實現這個函數提供一個自定義的曲線形狀為你的時間表。 **See also** [CurveShape](qtimeline.html#CurveShape-enum)和[frameForTime](qtimeline.html#frameForTime)( ) 。 * * * ## Qt Signal Documentation ``` void finished () ``` 這是該信號的默認超載。 這個信號被發射時[QTimeLine](qtimeline.html)完成(即達到其時間線的末端)和不循環。 ``` void frameChanged (int) ``` 這是該信號的默認超載。 [QTimeLine](qtimeline.html)以規則間隔發出該信號在時[Running](qtimeline.html#State-enum)狀態,但只有在當前幀的變化。_frame_是當前幀號。 **See also** [QTimeLine.setFrameRange](qtimeline.html#setFrameRange)()和[QTimeLine.updateInterval](qtimeline.html#updateInterval-prop)。 ``` void stateChanged (QTimeLine::State) ``` 這是該信號的默認超載。 這個信號被發射時[QTimeLine](qtimeline.html)的狀態變化。新的狀態是_newState_。 ``` void valueChanged (qreal) ``` 這是該信號的默認超載。 [QTimeLine](qtimeline.html)以規則間隔發出該信號在時[Running](qtimeline.html#State-enum)狀態,但只有當電流值而變化。_value_是當前值。_value_是一個介于0.0和1.0之間 **See also** [QTimeLine.setDuration](qtimeline.html#duration-prop)( )[QTimeLine.valueForTime](qtimeline.html#valueForTime)()和[QTimeLine.updateInterval](qtimeline.html#updateInterval-prop)。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看