本文整理汇总了C++中Progress::attach方法的典型用法代码示例。如果您正苦于以下问题:C++ Progress::attach方法的具体用法?C++ Progress::attach怎么用?C++ Progress::attach使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Progress
的用法示例。
在下文中一共展示了Progress::attach方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setCurrentDataset
void PreviewWidget::setCurrentDataset(ImportDescriptor* pDataset)
{
ImportDescriptor* pActiveDataset = getCurrentDataset();
if (pDataset == pActiveDataset)
{
return;
}
// Do nothing if the new current data set is not a data set in the current file
if (pDataset != NULL)
{
QMap<QString, vector<ImportDescriptor*> >::const_iterator iter = mDatasets.find(mCurrentFile);
if (iter != mDatasets.end())
{
vector<ImportDescriptor*> fileDatasets = iter.value();
if (std::find(fileDatasets.begin(), fileDatasets.end(), pDataset) == fileDatasets.end())
{
return;
}
}
}
mpCurrentDataset = pDataset;
// Delete the current preview
destroyPreview();
// Activate the label indicating that no data set preview is available
mpDatasetStack->setCurrentIndex(0);
// Check for no active data set
if (mpCurrentDataset == NULL)
{
emit currentDatasetChanged(mpCurrentDataset);
return;
}
// Only show the preview if the widget is visible or if the data set is imported
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);
//.........这里部分代码省略.........