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


C++ DataDescriptor::getParentDesignator方法代码示例

本文整理汇总了C++中DataDescriptor::getParentDesignator方法的典型用法代码示例。如果您正苦于以下问题:C++ DataDescriptor::getParentDesignator方法的具体用法?C++ DataDescriptor::getParentDesignator怎么用?C++ DataDescriptor::getParentDesignator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataDescriptor的用法示例。


在下文中一共展示了DataDescriptor::getParentDesignator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: fileInfo


//.........这里部分代码省略.........
         ImportDescriptor* pImportDescriptor = *datasetIter;
         if (pImportDescriptor == NULL)
         {
            continue;
         }

         DataDescriptor* pDescriptor = pImportDescriptor->getDataDescriptor();
         if (pDescriptor == NULL)
         {
            continue;
         }

         const string& name = pDescriptor->getName();
         if (name.empty())
         {
            continue;
         }

         QTreeWidgetItem* pItem = new QTreeWidgetItem(static_cast<QTreeWidget*>(NULL),
            QStringList() << QString::fromStdString(name));
         if (pItem == NULL)
         {
            continue;
         }

         // Tool tip
         pItem->setToolTip(0, QString::fromStdString(name));

         // Check state
         Qt::ItemFlags itemFlags = pItem->flags();
         itemFlags |= Qt::ItemIsUserCheckable;
         pItem->setFlags(itemFlags);

         if (pImportDescriptor->isImported())
         {
            pItem->setCheckState(0, Qt::Checked);

            if (pSelectItem == NULL)
            {
               pSelectItem = pItem;
            }
         }
         else
         {
            pItem->setCheckState(0, Qt::Unchecked);
         }

         // Add to the proper parent
         map<vector<string>, QTreeWidgetItem*>::iterator parent = parentPaths.find(pDescriptor->getParentDesignator());
         if (parent != parentPaths.end())
         {
            parent->second->addChild(pItem);
         }
         else
         {
            pFileItem->addChild(pItem);
         }

         vector<string> myDesignator = pDescriptor->getParentDesignator();
         myDesignator.push_back(pDescriptor->getName());
         parentPaths[myDesignator] = pItem;

         mDatasets[pImportDescriptor] = pItem;
         validateDataset(pDescriptor);
         enforceSelections(pItem);
      }
   }

   mpDatasetTree->expandAll();

   // Update the tab widget for the selected data set
   if (pSelectItem == NULL)
   {
      // No data set is set to import by default so select the first data set in the tree widget
      for (int i = 0; i < mpDatasetTree->topLevelItemCount() && pSelectItem == NULL; ++i)
      {
         QTreeWidgetItem* pParentItem = mpDatasetTree->topLevelItem(i);
         if ((pParentItem != NULL) && (pParentItem->childCount() > 0))
         {
            pSelectItem = pParentItem->child(0);
         }
      }
   }

   if (pSelectItem != NULL)
   {
      mpDatasetTree->setItemSelected(pSelectItem, true);
      updateEditDataset();
   }

   // Connections
   VERIFYNR(connect(mpDatasetTree, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this,
      SLOT(datasetItemChanged(QTreeWidgetItem*))));
   VERIFYNR(connect(mpDatasetTree, SIGNAL(itemSelectionChanged()), this, SLOT(updateEditDataset())));
   VERIFYNR(connect(pImportAllButton, SIGNAL(clicked()), this, SLOT(selectAllDatasets())));
   VERIFYNR(connect(pImportNoneButton, SIGNAL(clicked()), this, SLOT(deselectAllDatasets())));
   VERIFYNR(connect(mpOkButton, SIGNAL(clicked()), this, SLOT(accept())));
   VERIFYNR(connect(pCancelButton, SIGNAL(clicked()), this, SLOT(reject())));
   updateConnections(true);
}
开发者ID:Siddharthk,项目名称:opticks,代码行数:101,代码来源:ImportOptionsDlg.cpp


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