本文整理汇总了C++中DataDescriptor::copy方法的典型用法代码示例。如果您正苦于以下问题:C++ DataDescriptor::copy方法的具体用法?C++ DataDescriptor::copy怎么用?C++ DataDescriptor::copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataDescriptor
的用法示例。
在下文中一共展示了DataDescriptor::copy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setCurrentDataset
void ImportOptionsDlg::setCurrentDataset(ImportDescriptor* pImportDescriptor)
{
if (pImportDescriptor == NULL)
{
return;
}
if (pImportDescriptor == mpCurrentDataset)
{
return;
}
// Apply changes to the current data set if necessary
bool bSuccess = true;
if ((mpCurrentDataset != NULL) && (mEditDataDescriptorModified == true))
{
if (mPromptForChanges == true)
{
int iReturn = QMessageBox::question(this, APP_NAME, "Apply changes to data?",
QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::Cancel);
if ((iReturn == QMessageBox::Yes) || (iReturn == QMessageBox::YesToAll))
{
bSuccess = applyChanges();
if (iReturn == QMessageBox::YesToAll)
{
mPromptForChanges = false;
}
}
else if (iReturn == QMessageBox::No)
{
// Update the validation icon for the original data descriptor
validateDataset(mpCurrentDataset->getDataDescriptor());
}
else if (iReturn == QMessageBox::Cancel)
{
bSuccess = false;
}
}
else
{
bSuccess = applyChanges();
}
}
if (bSuccess == false)
{
// Select the tree widget item for the previously selected data set
selectCurrentDatasetItem();
return;
}
mpCurrentDataset = pImportDescriptor;
// Destroy the existing edit data descriptor if necessary
Service<ModelServices> pModel;
if (mpEditDescriptor != NULL)
{
Classification* pClassification = mpEditDescriptor->getClassification();
if (pClassification != NULL)
{
VERIFYNR(pClassification->detach(SIGNAL_NAME(Subject, Modified),
Slot(this, &ImportOptionsDlg::editClassificationModified)));
}
RasterDataDescriptor* pRasterDescriptor = dynamic_cast<RasterDataDescriptor*>(mpEditDescriptor);
if (pRasterDescriptor != NULL)
{
VERIFYNR(pRasterDescriptor->detach(SIGNAL_NAME(RasterDataDescriptor, RowsChanged),
Slot(this, &ImportOptionsDlg::editDataDescriptorRowsModified)));
VERIFYNR(pRasterDescriptor->detach(SIGNAL_NAME(RasterDataDescriptor, ColumnsChanged),
Slot(this, &ImportOptionsDlg::editDataDescriptorColumnsModified)));
VERIFYNR(pRasterDescriptor->detach(SIGNAL_NAME(RasterDataDescriptor, BandsChanged),
Slot(this, &ImportOptionsDlg::editDataDescriptorBandsModified)));
}
RasterFileDescriptor* pRasterFileDescriptor =
dynamic_cast<RasterFileDescriptor*>(mpEditDescriptor->getFileDescriptor());
if (pRasterFileDescriptor != NULL)
{
VERIFYNR(pRasterFileDescriptor->detach(SIGNAL_NAME(RasterFileDescriptor, RowsChanged),
Slot(this, &ImportOptionsDlg::editFileDescriptorRowsModified)));
VERIFYNR(pRasterFileDescriptor->detach(SIGNAL_NAME(RasterFileDescriptor, ColumnsChanged),
Slot(this, &ImportOptionsDlg::editFileDescriptorColumnsModified)));
VERIFYNR(pRasterFileDescriptor->detach(SIGNAL_NAME(RasterFileDescriptor, BandsChanged),
Slot(this, &ImportOptionsDlg::editFileDescriptorBandsModified)));
}
VERIFYNR(mpEditDescriptor->detach(SIGNAL_NAME(Subject, Modified),
Slot(this, &ImportOptionsDlg::editDataDescriptorModified)));
pModel->destroyDataDescriptor(mpEditDescriptor);
mpEditDescriptor = NULL;
mEditDataDescriptorModified = false;
}
// Create a new data descriptor to validate the user inputs
DataDescriptor* pDescriptor = mpCurrentDataset->getDataDescriptor();
if (pDescriptor != NULL)
{
mpEditDescriptor = pDescriptor->copy();
}
//.........这里部分代码省略.........