#include "ccstablefix.h" #include "ccscolumn.h" #include "common_types.h" #include "reportdataset.h" using namespace std; namespace CCS_Report{ CCSTableFix::CCSTableFix(QObject *parent):CCSTable(new CCSTableFixPrivate,parent) { m_frame = 0; } CCSTableFix::CCSTableFix(CCSTableFixPrivate *dd, QObject * parent) :CCSTable(dd, parent) { } CCSTableFix::~CCSTableFix() { } CCSBaseItemInterface *CCSTableFix::createInstance(QObject * parent) const { return new CCSTableFix(parent); } CCSBaseItemInterface * CCSTableFix::itemClone() const { Q_D(const CCSTableFix); return new CCSTableFix(new CCSTableFixPrivate(*d), parent()); } CCSBaseItemInterface *CCSTableFix::clone(bool withChildren, bool init) const { CCSTableFix * newTablefix = qobject_cast(itemClone()); //newTablefix->setReportCore(this->reportCore()); if (withChildren) { foreach (CCSBaseItemInterface* item, findChildren(QString(),Qt::FindDirectChildrenOnly)) { if (item->parent() != this) continue; CCSBaseItemInterface * itemCopy = item->clone(true, false); //itemCopy->setReportCore(item->reportCore()); itemCopy->setParent(newTablefix); itemCopy->setObjectName(item->objectName()); } } return newTablefix; } int CCSTableFix::frame() const { return m_frame; } void CCSTableFix::SetFrame(const int &frames) { m_frame = frames; } int CCSTableFix::Parse(QList>& tablesinfo, QList>& groupkey) { int iRtn = 0; if (selected() == 1) { foreach (CCS_Report::CCSColumnHeader* itemcol, columnheaders()) { //ParseColumn(itemcol,groupkey); ReportFunPara para = itemcol->ParseColumn(groupkey); for (auto o : para.listRtn) { if (o == NOSHOW) { iRtn = -1; break; } } if (iRtn == -1) { break; } } if (iRtn == -1) tablesinfo.append(QPair(this, false)); else tablesinfo.append(QPair(this, true)); } else { tablesinfo.append(QPair(this, false)); } return 0; } void CCSTableFix::exeFunction(ReportFunPara& arg) { foreach (CCSBaseItemInterface* item, findChildren(QString(),Qt::FindDirectChildrenOnly)) { if (item->parent() != this) continue; item->exeFunction(arg); } } }