42 #include "ui_progress.h" 44 #include <qbluetoothdeviceinfo.h> 45 #include <qbluetoothaddress.h> 46 #include <qbluetoothtransferrequest.h> 47 #include <qbluetoothtransferreply.h> 56 ui->progressBar->setRange(0, 1);
57 connect(ui->cancelButton, SIGNAL(clicked()),
this, SLOT(close()));
66 ui->titleLabel->setText(title);
67 ui->statusLabel->setText(filename);
71 if (reply->error() != QBluetoothTransferReply::NoError){
72 ui->progressBar->setDisabled(
true);
73 ui->statusLabel->setText(tr(
"Failed: %1").arg(reply->errorString()));
76 ui->statusLabel->setText(tr(
"Transfer complete"));
78 ui->cancelButton->setText(tr(
"Dismiss"));
87 ui->progressBar->setMaximum(bytesTotal);
88 ui->progressBar->setValue(bytesSent);
89 if (bytesSent && bytesTotal &&
90 (start.elapsed() > 1000) &&
91 (bytesSent > start.elapsed()/1000)) {
93 ui->statusLabel->setText(tr(
"Transferring...ETA: %1s")
94 .arg(((bytesTotal-bytesSent)/(bytesSent/(start.elapsed()/1000)))));
void finished(QBluetoothTransferReply *)
void setStatus(QString title, QString filename)
Progress(QWidget *parent=0)
void uploadProgress(qint64 bytesSent, qint64 bytesTotal)