当前位置: 首页>>代码示例>>C++>>正文


C++ Progress::detach方法代码示例

本文整理汇总了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));
      }
   }
}
开发者ID:Siddharthk,项目名称:opticks,代码行数:101,代码来源:PreviewWidget.cpp


注:本文中的Progress::detach方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。