• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            Cpper
            C/C++高級工程師 Android高級軟件工程師 IT集成工程師 音頻工程師 熟悉c,c++,java,c#,py,js,asp等多種語言 程序猿
            一個簡單的代碼如下:
            #include <QtGui/QApplication>
            #include <QtGui>
            #include <math.h>
            int main(int argc, char *argv[])
            {
             QApplication a(argc, argv);
             QGraphicsItem *ball = new QGraphicsEllipseItem(0,0,20,40);
             QTimeLine *timer = new QTimeLine(15000);
             timer->setFrameRange(0,100);
             QGraphicsItemAnimation *animation = new QGraphicsItemAnimation;
             animation->setItem(ball);
             animation->setTimeLine(timer);
             for(int i = 0; i < 600; ++i)
             animation->setPosAt(i / 600.0, QPointF(i, i));
             QGraphicsScene *scene = new QGraphicsScene();
             scene->setBackgroundBrush(QBrush(Qt::blue));
             scene->setSceneRect(0,0,250,250);
             scene->addItem(ball);
             QGraphicsView *view = new QGraphicsView(scene);
             view->setBackgroundBrush(QBrush(Qt::red));
             view->show();
             timer->start();
             return a.exec();
            }

            另外一個例子如下:
            #ifndef TIMELINE_H
            #define TIMELINE_H
            #include 
            <QtGui/QWidget>
            #include 
            <QVBoxLayout>
            #include 
            <QTimeLine>
            #include 
            <QProgressBar>
            #include 
            <QPushButton>

            class timeline : public QWidget
            {
                Q_OBJECT
            public:
                timeline(QWidget 
            *parent = 0);
                
            ~timeline();
            private:
                QPushButton 
            *pushButton;
                QTimeLine 
            *timeLine;
                QProgressBar 
            *progressBar;
                QVBoxLayout 
            *layout;
            };

            #endif // TIMELINE_H

            #include 
            "timeline.h"

            timeline::timeline(QWidget 
            *parent):QWidget(parent)
            {
                layout
            = new QVBoxLayout(this);
                progressBar 
            = new QProgressBar(this);
                progressBar
            ->setRange(0100);

                
            // Construct a 5-second timeline with a frame range of 0 - 100
                timeLine = new QTimeLine(5000this);
                timeLine
            ->setFrameRange(0100);
                connect(timeLine, SIGNAL(frameChanged(
            int)), progressBar, SLOT(setValue(int)));

                
            // Clicking the push button will start the progress bar animation
                pushButton = new QPushButton(tr("Start animation"), this);
                connect(pushButton, SIGNAL(clicked()), timeLine, SLOT(start()));
                layout
            ->addWidget(progressBar);
                layout
            ->addWidget(pushButton);
                setLayout(layout);
            }

            timeline::
            ~timeline()
            {
               
            // No need to delete any QObject that got proper parent pointer.
            }

            簡單的說 QTimeLine就是一個帶有線程的對象,通過設置持續時間和幀數來控制動畫
            posted on 2011-09-07 20:26 ccsdu2009 閱讀(4093) 評論(0)  編輯 收藏 引用 所屬分類: QT編程
             
            99久久夜色精品国产网站| 一本久久久久久久| 97久久国产综合精品女不卡| 亚洲精品无码久久久久sm| AV狠狠色丁香婷婷综合久久| 久久国产高清字幕中文| 久久亚洲AV永久无码精品| 人人狠狠综合久久88成人| 激情久久久久久久久久| 无码AV中文字幕久久专区| 一本色道久久88加勒比—综合| 香蕉久久久久久狠狠色| 久久香蕉国产线看观看乱码| 久久久这里只有精品加勒比| 日本一区精品久久久久影院| 久久精品免费一区二区| 婷婷综合久久狠狠色99h| 色天使久久综合网天天| 久久九九亚洲精品| 亚洲AV日韩精品久久久久久| 欧美性大战久久久久久| 品成人欧美大片久久国产欧美| 色婷婷综合久久久久中文| 一97日本道伊人久久综合影院| 国产99久久九九精品无码| 狠狠久久亚洲欧美专区| 欧美喷潮久久久XXXXx| 久久这里有精品| 伊人久久大香线蕉AV一区二区| 久久精品中文字幕一区| 国产精品成人久久久久三级午夜电影 | 国内精品伊人久久久久av一坑 | 亚洲午夜精品久久久久久浪潮| 国产成人无码精品久久久免费| 久久伊人精品青青草原高清| 91精品国产91久久久久福利| 成人妇女免费播放久久久| 国产精品美女久久久久久2018| 久久精品a亚洲国产v高清不卡| 亚洲av伊人久久综合密臀性色| 亚洲va久久久噜噜噜久久男同 |