13 const auto connection = Qt::QueuedConnection;
45 const QString &message,
const double estimatedTime,
46 const int progressPrecision) {
47 progressBar->setValue(
static_cast<int>(progress * 100));
49 std::ostringstream mess;
50 if (!message.isEmpty()) {
51 mess << message.toStdString() <<
" ";
53 mess.precision(progressPrecision);
54 mess << std::fixed << progress * 100 <<
"%";
55 if (estimatedTime > 0.5) {
58 if (estimatedTime < 60)
59 mess << static_cast<int>(estimatedTime) <<
"s";
60 else if (estimatedTime < 60 * 60) {
61 int min =
static_cast<int>(estimatedTime / 60);
62 int sec =
static_cast<int>(estimatedTime - min * 60);
63 mess << min <<
"m" << std::setfill(
'0') << std::setw(2) << sec <<
"s";
65 int hours =
static_cast<int>(estimatedTime / 3600);
66 int min =
static_cast<int>((estimatedTime - hours * 3600) / 60);
67 mess << hours <<
"h" << std::setfill(
'0') << std::setw(2) << min <<
"m";
71 QString formatStr = QString::fromStdString(mess.str());
72 progressBar->setFormat(formatStr);
83 const std::string &msg,
const double estimatedTime,
84 const int progressPrecision) {
void * AlgorithmID
As we have multiple interfaces to the same logical algorithm we need a way of uniquely identifying ma...