• <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就是一個帶有線程的對象,通過設(shè)置持續(xù)時間和幀數(shù)來控制動畫
            posted on 2011-09-07 20:26 ccsdu2009 閱讀(4094) 評論(0)  編輯 收藏 引用 所屬分類: QT編程
             
            免费久久人人爽人人爽av| 久久人爽人人爽人人片AV| 国产亚洲欧美精品久久久| 国产欧美久久久精品| 久久伊人色| 国产99久久九九精品无码| 日韩精品久久久久久久电影| 狠狠色丁香婷婷综合久久来来去 | avtt天堂网久久精品| 久久精品国产亚洲77777| 国内精品伊人久久久久影院对白| 人妻无码久久精品| 国产精品免费看久久久香蕉| 久久天天躁狠狠躁夜夜av浪潮 | 99久久精品日本一区二区免费| 久久婷婷色香五月综合激情| 久久久久久久97| 伊人久久精品无码二区麻豆| 91久久精品国产成人久久| 久久精品国产亚洲AV无码娇色| 色播久久人人爽人人爽人人片aV | 天天影视色香欲综合久久| 久久99免费视频| 69久久夜色精品国产69| 久久久久久亚洲Av无码精品专口| 欧美精品福利视频一区二区三区久久久精品 | 久久无码高潮喷水| 天天综合久久久网| 精品久久久久一区二区三区| 老色鬼久久亚洲AV综合| 亚洲午夜无码久久久久| 一级做a爰片久久毛片看看| 久久天天躁夜夜躁狠狠| 久久人人爽人人爽人人片AV高清 | 久久婷婷国产综合精品| 久久精品国产99国产精品亚洲 | 久久国产三级无码一区二区| 亚洲七七久久精品中文国产| 久久久久久A亚洲欧洲AV冫| 久久免费国产精品一区二区| 欧美精品一本久久男人的天堂|