| 247 | } |
| 248 | |
| 249 | void StatusBar::showProgress( IStatus* status, int minimum, int maximum, int value) |
| 250 | { |
| 251 | QPointer<QObject> context = dynamic_cast<QObject*>(status); |
| 252 | QTimer::singleShot(0, this, [this, context, status, minimum, maximum, value]() { |
| 253 | if (!context) |
| 254 | return; |
| 255 | auto progressItemIt = m_progressItems.find(status); |
| 256 | if (progressItemIt == m_progressItems.end()) { |
| 257 | // Transfer an existing status message (if any) to the new progress item where it belongs. |
| 258 | const auto statusMessage = takeMessage(status); |
| 259 | bool canBeCanceled = false; |
| 260 | progressItemIt = m_progressItems.insert(status, m_progressController->createProgressItem( |
| 261 | ProgressManager::createUniqueID(), status->statusName(), statusMessage, canBeCanceled)); |
| 262 | } |
| 263 | |
| 264 | ProgressItem* i = *progressItemIt; |
| 265 | m_progressWidget->raise(); |
| 266 | m_progressDialog->raise(); |
| 267 | if( minimum == 0 && maximum == 0 ) { |
| 268 | i->setUsesBusyIndicator( true ); |
| 269 | } else { |
| 270 | i->setUsesBusyIndicator( false ); |
| 271 | i->setProgress( 100*value/maximum ); |
| 272 | } |
| 273 | }); |
| 274 | } |
| 275 | |
| 276 | } |
| 277 |
nothing calls this directly
no test coverage detected