#include "FITKAbstractFields.h" namespace Interface { FITKAbstractFiled::~FITKAbstractFiled() { //todo } FITKAbstractFiled::FITKFieldType FITKAbstractFiled::getFieldType() { //错误值 return FITKAbstractFiled::FITKFieldType::FFTNone; } void FITKAbstractFiled::setDescribe(const QString & des) { _describe = des; } QString FITKAbstractFiled::getDescribe() const { //描述 return _describe; } bool FITKAbstractFiled::copy(FITKAbstractDataObject* obj) { FITKAbstractFiled* f = dynamic_cast(obj); if (f == nullptr) return false; _describe = f->getDescribe(); return Core::FITKAbstractNDataObject::copy(obj); } QList FITKFieldsManager::getFields(FITKAbstractFiled::FITKFieldType t) { QList fs; const int n = this->getDataCount(); //遍历全部成员 for (int i =0 ; igetDataByIndex(i); if(f == nullptr) continue; //类型判断 if (t == f->getFieldType()) fs.append(f); } //返回相同类型的列表 return fs; } }