免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
[Qt 練習(xí)]QProgressBar
轉(zhuǎn)載:http://blog.chinaunix.net/uid-27225886-id-3352398.html
progressbar.h
點(diǎn)擊(此處)折疊或打開
#ifndef PROGRESSBAR_H
#define PROGRESSBAR_H
#include <QProgressBar>
class QString;
class ProgressBar: public QProgressBar
{
Q_OBJECT
public:
ProgressBar(QWidget *parent = 0):QProgressBar(parent){}
QString strText;
public slots:
void stepOne();
};
#endif // PROGRESSBAR_H
progressbar.cpp
點(diǎn)擊(此處)折疊或打開
#include "progressbar.h"
#include <QString>
void ProgressBar::stepOne()
{
if(this->value()+1 <= this->maximum())
{
this->setValue(this->value()+1);
strText = "QProgressBar Test : "+this->text();
this->setWindowTitle(strText);
}
else
{
this->setValue(this->minimum());
}
}
main.cpp
點(diǎn)擊(此處)折疊或打開
#include <QApplication>
#include <QTimer>
#include "progressbar.h"
int main(int argc, char**argv)
{
QApplication app(argc, argv);
//progressBar
ProgressBar *progressBar = new ProgressBar;
progressBar->setWindowTitle("QProgressBar Test");
progressBar->resize(400,40);
progressBar->setMaximum(100);
progressBar->setMinimum(0);
progressBar->setValue(0);
//define a timer
QTimer *timer = new QTimer;
timer->start(500);
QObject::connect(timer, SIGNAL(timeout()), progressBar, SLOT(stepOne()));
progressBar->show();
return app.exec();
}
運(yùn)行效果圖
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
自定義控件之------QProgressBar的自定義
02、Qt定時器及實(shí)現(xiàn)(詳解)
Qt之QTimer
【pyqt5學(xué)習(xí)】
Qt-----進(jìn)度條QProgressBar
設(shè)計(jì)Qt風(fēng)格的C++API | 筒子樓
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服