本文整理汇总了C++中Progress::detach方法的典型用法代码示例。如果您正苦于以下问题:C++ Progress::detach方法的具体用法?C++ Progress::detach怎么用?C++ Progress::detach使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Progress
的用法示例。
在下文中一共展示了Progress::detach方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setCurrentDataset
//.........这里部分代码省略.........
if ((isVisible() == false) || (mpCurrentDataset->isImported() == false))
{
if (pActiveDataset != NULL)
{
emit currentDatasetChanged(NULL);
}
return;
}
if (mpImporter != NULL)
{
Service<PlugInManagerServices> pManager;
Progress* pProgress = pManager->getProgress(dynamic_cast<PlugIn*>(mpImporter));
if (pProgress != NULL)
{
pProgress->attach(SIGNAL_NAME(Subject, Modified), Slot(this, &PreviewWidget::progressUpdated));
pProgress->updateProgress("Getting preview...", 0, NORMAL);
}
// Activate the progress bar
mpDatasetStack->setCurrentIndex(1);
// Update the data set label
QMap<QString, vector<ImportDescriptor*> >::const_iterator iter = mDatasets.find(mCurrentFile);
VERIFYNRV(iter != mDatasets.end());
vector<ImportDescriptor*> fileDatasets = iter.value();
unsigned int iIndex = 0;
unsigned int numDatasets = fileDatasets.size();
for (iIndex = 0; iIndex < numDatasets; ++iIndex)
{
ImportDescriptor* pCurrentDataset = fileDatasets[iIndex];
if (pCurrentDataset == pDataset)
{
break;
}
}
VERIFYNRV(iIndex < numDatasets);
const DataDescriptor* pDescriptor = mpCurrentDataset->getDataDescriptor();
VERIFYNRV(pDescriptor != NULL);
mpDatasetLabel->setText("<b>Data Set (" + QString::number(iIndex + 1) + " of " +
QString::number(numDatasets) + "):</b> " + QString::fromStdString(pDescriptor->getName()));
// Process events to erase the no preview available page
qApp->processEvents();
// Get the preview from the importer
mpImporterWidget = mpImporter->getPreview(pDescriptor, pProgress);
if (mpImporterWidget != NULL)
{
// Display the preview widget
SpatialDataView* pView = dynamic_cast<SpatialDataView*>(mpImporterWidget);
if (pView != NULL)
{
ChippingWidget* pChippingWidget = new ChippingWidget(pView,
dynamic_cast<const RasterDataDescriptor*>(pDescriptor), mpPreview);
VERIFYNRV(pChippingWidget != NULL);
VERIFYNR(connect(pChippingWidget, SIGNAL(chipChanged()), this, SLOT(updateCurrentDataset())));
mpImporterWidget = pChippingWidget;
}
else
{
mpImporterWidget->setParent(mpPreview);
}
QGridLayout* pGrid = dynamic_cast<QGridLayout*>(mpPreview->layout());
if (pGrid != NULL)
{
pGrid->addWidget(mpImporterWidget, 0, 0);
}
// Activate the preview widget
mpDatasetStack->setCurrentIndex(2);
// Notify of changes
emit currentDatasetChanged(mpCurrentDataset);
}
else
{
mpDatasetStack->setCurrentIndex(0);
if (pActiveDataset != NULL)
{
emit currentDatasetChanged(NULL);
}
}
if (pProgress != NULL)
{
pProgress->detach(SIGNAL_NAME(Subject, Modified), Slot(this, &PreviewWidget::progressUpdated));
}
}
}