QT实验报告 - 图文(8)

2019-08-31 12:41

安庆师范学院计算机与信息学院

Anqing teacher school College of computer and information

voidWidget::onDownloadProgress(qint64bytesReceived,qint64bytesTotal) {

if(bytesTotal>0) {

intvalue=(bytesReceived*100)/bytesTotal; m_progress->setValue(value); } }

voidWidget::onUploadProgress(qint64bytesSent,qint64bytesTotal) {

if(bytesTotal>0) {

intvalue=(bytesSent*100)/bytesTotal; m_progress->setValue(value); } }

voidWidget::onReadyRead() {

QByteArraydata=m_reply->readAll();

m_stateText->append(QString(\).arg(data.length())); if(m_file) {

m_file->write(data); } }

voidWidget::onFinished() {

QStringstrState=m_reply->error()==QNetworkReply::NoError?\\:m_reply->errorString();

m_stateText->append(QString(\) .arg(strState));

m_stateText->append(\); resetState(); }

voidWidget::resetState() {

if(m_file) {

m_file->close();

第33页共61页

面向对象程序设计:实验报告

安庆师范学院计算机与信息学院

Anqing teacher school College of computer and information

deletem_file; m_file=0; }

if(m_request) {

deletem_request; m_request=0; }

if(m_reply) {

m_reply->disconnect(this); m_reply->deleteLater(); m_reply=0; }

enableControls(); }

boolWidget::openFile(boolsave,QString&errorString) {

if(m_strFilePath.isEmpty()) {

errorString=\; returnfalse; }

if(m_file) {

deletem_file; m_file=0; }

m_file=newQFile(m_strFilePath);

if(!m_file->open(save?QFile::WriteOnly:QFile::ReadOnly)) {

errorString=m_file->errorString(); deletem_file; m_file=0; returnfalse; }

returntrue; }

第34页共61页

面向对象程序设计:实验报告

安庆师范学院计算机与信息学院

Anqing teacher school College of computer and information

六、实验结果与分析

第35页共61页

面向对象程序设计:实验报告

安庆师范学院计算机与信息学院

Anqing teacher school College of computer and information

第36页共61页

面向对象程序设计:实验报告

安庆师范学院计算机与信息学院

Anqing teacher school College of computer and information

七、教师评价

第37页共61页

面向对象程序设计:实验报告


QT实验报告 - 图文(8).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:劳动法期中作业答案(2)

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: