Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/statuswidget.cpp
Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Line(s) | |||||
101 | } | 101 | } | ||
102 | 102 | | |||
103 | void StatusWidget::updatePrintTime() | 103 | void StatusWidget::updatePrintTime() | ||
104 | { | 104 | { | ||
105 | QTime temp(0, 0, 0); | 105 | QTime temp(0, 0, 0); | ||
106 | lblTime->setText(temp.addMSecs(printTime->elapsed()).toString(QStringLiteral("hh:mm:ss"))); | 106 | lblTime->setText(temp.addMSecs(printTime->elapsed()).toString(QStringLiteral("hh:mm:ss"))); | ||
107 | } | 107 | } | ||
108 | 108 | | |||
109 | void StatusWidget::updatePrintProgress(const float &progress) | 109 | void StatusWidget::updatePrintProgress(const int progress) | ||
110 | { | 110 | { | ||
111 | printingProgress->setValue(progress); | 111 | printingProgress->setValue(progress); | ||
112 | if (progress >= 1) { | 112 | if (progress >= 1) { | ||
113 | QTime temp(0, 0, 0); | 113 | QTime temp(0, 0, 0); | ||
114 | lblTimeLeft->setText(temp.addMSecs((100 - progress) * (printTime->elapsed() / progress)).toString(QStringLiteral("hh:mm:ss"))); | 114 | lblTimeLeft->setText(temp.addMSecs((100 - progress) * (printTime->elapsed() / progress)).toString(QStringLiteral("hh:mm:ss"))); | ||
115 | } else { | 115 | } else { | ||
116 | lblTimeLeft->setText(QStringLiteral("??:??:??")); | 116 | lblTimeLeft->setText(QStringLiteral("??:??:??")); | ||
117 | } | 117 | } | ||
118 | } | 118 | } |