• <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 閱讀(4086) 評論(0)  編輯 收藏 引用 所屬分類: QT編程
             
            久久国产精品二国产精品| 久久精品国产久精国产思思| 99久久国产亚洲高清观看2024 | 精品一区二区久久| 久久久久久综合一区中文字幕| 激情久久久久久久久久| 久久久国产视频| 97超级碰碰碰久久久久| 久久久久久久99精品免费观看| 久久亚洲精品无码观看不卡| 漂亮人妻被中出中文字幕久久| 69SEX久久精品国产麻豆| 久久久久久一区国产精品| 久久国产劲爆AV内射—百度| 欧美久久精品一级c片片| 久久婷婷色香五月综合激情| 国产精品无码久久久久久| 看全色黄大色大片免费久久久 | 久久精品国产网红主播| 要久久爱在线免费观看| 久久综合综合久久97色| 亚洲精品tv久久久久久久久 | 久久亚洲美女精品国产精品| 久久久久综合中文字幕| 国产精品久久网| 婷婷伊人久久大香线蕉AV| 人人狠狠综合88综合久久| 久久精品亚洲中文字幕无码麻豆 | 色偷偷88888欧美精品久久久| 久久精品国产72国产精福利| av午夜福利一片免费看久久| 国内精品久久久久影院薰衣草| 久久99精品久久久久久9蜜桃| 国产韩国精品一区二区三区久久| 日韩欧美亚洲综合久久 | 久久精品水蜜桃av综合天堂| 久久精品国产亚洲AV忘忧草18 | 久久精品国产亚洲Aⅴ蜜臀色欲| 国产69精品久久久久777| 91精品国产高清91久久久久久| 久久亚洲中文字幕精品有坂深雪|