• <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>

            zhonghua

            C++博客 首頁 新隨筆 聯系 聚合 管理
              72 Posts :: 1 Stories :: 4 Comments :: 0 Trackbacks
            #include <QApplication>
            #include <QThread>
            #include <QMainWindow>
            #include <QProgressBar>
            #include <QPushButton>
            class RenderThread : public QThread
            {
             Q_OBJECT
            signals:
             void notify(int);
            public:
             RenderThread(QObject *parent = 0): QThread(parent)
             {
             };
             void test()
             {
             start(HighestPriority);
             };
            protected:
             void run()
             {
             int i =0;
             while (i<101)
             {
             msleep(50);
             i++;
             emit notify(i);
             }
             };
            };
            class MainWindow : public QMainWindow
            {
             Q_OBJECT
            public:
             MainWindow(QWidget *parent = 0)
             {
             resize(600, 400);
             centralWidget = new QWidget(this);
             progressBar = new QProgressBar(centralWidget);
             progressBar->setGeometry(QRect(130, 180, 321, 23));
             progressBar->setValue(0);
             pushButton = new QPushButton("test",centralWidget);
             pushButton->setGeometry(QRect(110, 100, 75, 23));
             QObject::connect(pushButton, SIGNAL(clicked()), this, SLOT(OnClicked()));
             this->setCentralWidget(centralWidget);
             };
             ~MainWindow(){};
            private:
             QProgressBar *progressBar;
             QPushButton *pushButton;
             QWidget *centralWidget;
             RenderThread render;
            public slots:
             void OnClicked()
             {
             connect(&render,SIGNAL(notify(int)),this,SLOT(OnNotify(int)));
             render.test();
             };
             void OnNotify(int i)
             {
             progressBar->setValue(i);
             };
            };
            #include "test.moc"
            int main(int argc,char* argv[])
            {
             QApplication app(argc,argv);
             MainWindow window;
             window.show();
             return app.exec();
            }

            posted on 2012-04-28 13:50 米米 閱讀(2135) 評論(0)  編輯 收藏 引用
            久久精品水蜜桃av综合天堂| 久久99精品九九九久久婷婷| 久久精品国产亚洲AV不卡| 一级a性色生活片久久无| 7777久久亚洲中文字幕| 国产亚洲精品久久久久秋霞| 99热成人精品免费久久| av无码久久久久不卡免费网站| 一本一道久久综合狠狠老| 久久青青草原精品影院| 69SEX久久精品国产麻豆| 精品久久久无码中文字幕| 伊人久久大香线蕉AV色婷婷色| 久久国产精品一区| 99国产精品久久久久久久成人热| 久久久久无码精品| 久久综合狠狠色综合伊人| 久久99精品久久久大学生| 99精品国产免费久久久久久下载| 久久99久久无码毛片一区二区| 伊人久久大香线蕉综合网站| 国产精品久久久久无码av| 久久精品中文闷骚内射| 久久久一本精品99久久精品88| 7国产欧美日韩综合天堂中文久久久久 | 欧美日韩精品久久久久| 久久精品二区| 91久久精品国产免费直播| 久久99精品久久久久久久久久| 久久亚洲精品国产精品婷婷 | 久久精品国产99国产电影网| 99久久99久久| 久久国产精品77777| 97精品依人久久久大香线蕉97| 久久五月精品中文字幕| 蜜臀av性久久久久蜜臀aⅴ | 久久精品国产亚洲AV香蕉| 久久香蕉国产线看观看猫咪?v| 观看 国产综合久久久久鬼色 欧美 亚洲 一区二区 | 香港aa三级久久三级| 久久亚洲国产午夜精品理论片 |