COMPASSi/trunk/code/3rd/CCSReport_2/src/items/ccstablefix.cpp

104 lines
2.6 KiB
C++
Raw Normal View History

2025-06-25 15:06:42 +08:00

#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<CCSTableFix*>(itemClone());
//newTablefix->setReportCore(this->reportCore());
if (withChildren) {
foreach (CCSBaseItemInterface* item, findChildren<CCS_Report::CCSBaseItemInterface*>(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<QPair<CCSTableInterface*, int>>& tablesinfo, QList<QPair<QString, QString>>& 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<CCSTableInterface*, int>(this, false));
else
tablesinfo.append(QPair<CCSTableInterface*, int>(this, true));
}
else
{
tablesinfo.append(QPair<CCSTableInterface*, int>(this, false));
}
return 0;
}
void CCSTableFix::exeFunction(ReportFunPara& arg)
{
foreach (CCSBaseItemInterface* item, findChildren<CCSBaseItemInterface*>(QString(),Qt::FindDirectChildrenOnly))
{
if (item->parent() != this)
continue;
item->exeFunction(arg);
}
}
}