本文整理汇总了C++中Progress::getProgress方法的典型用法代码示例。如果您正苦于以下问题:C++ Progress::getProgress方法的具体用法?C++ Progress::getProgress怎么用?C++ Progress::getProgress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Progress
的用法示例。
在下文中一共展示了Progress::getProgress方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: progressUpdated
void PreviewWidget::progressUpdated(Subject& subject, const string& signal, const boost::any& value)
{
Progress* pProgress = dynamic_cast<Progress*>(&subject);
if (NN(pProgress))
{
// Get the current Progress values
string label = "";
int iPercent = 0;
ReportingLevel reportLevel = NORMAL;
pProgress->getProgress(label, iPercent, reportLevel);
// Set the label text if there is new text
QString strOldLabel = mpProgressLabel->text();
QString strLabel;
if (label.empty() == false)
{
strLabel = QString::fromStdString(label);
}
if (strLabel != strOldLabel)
{
mpProgressLabel->setText(strLabel);
mpProgressLabel->repaint();
}
// Set the progress percentage only if it is a new value
int iOldPercent = mpProgressBar->value();
if (iPercent != iOldPercent)
{
mpProgressBar->setValue(iPercent);
}
}
}
示例2: reportMessage
void reportMessage(const char* pMessage, void* pClientData)
{
Progress* pProgress = reinterpret_cast<Progress*>(pClientData);
if ((pProgress != NULL) && (pMessage != NULL))
{
std::string currentMessage;
int percent = 0;
ReportingLevel level;
pProgress->getProgress(currentMessage, percent, level);
pProgress->updateProgress(std::string(pMessage), percent, NORMAL);
}
}