38 lines
722 B
C++
38 lines
722 B
C++
|
#include "errorcodestateitem.h"
|
||
|
|
||
|
ErrorCodeStateItem::ErrorCodeStateItem(QObject *parent) : QObject(parent)
|
||
|
{
|
||
|
clean();
|
||
|
}
|
||
|
|
||
|
ErrorCodeStateItem::~ErrorCodeStateItem()
|
||
|
{
|
||
|
clean();
|
||
|
}
|
||
|
|
||
|
ErrorCodeStateItem::ErrorCodeStateItem(const ErrorCodeStateItem &item) : QObject()
|
||
|
{
|
||
|
copyData(item);
|
||
|
}
|
||
|
|
||
|
ErrorCodeStateItem &ErrorCodeStateItem::operator=(const ErrorCodeStateItem &item)
|
||
|
{
|
||
|
copyData(item);
|
||
|
return *this;
|
||
|
}
|
||
|
|
||
|
void ErrorCodeStateItem::clean()
|
||
|
{
|
||
|
m_code = 0;
|
||
|
m_name.clear();
|
||
|
}
|
||
|
|
||
|
void ErrorCodeStateItem::copyData(const ErrorCodeStateItem &item)
|
||
|
{
|
||
|
if (this != &item)
|
||
|
{
|
||
|
this->m_code = item.m_code ; // 代码
|
||
|
this->m_name = item.m_name ; // 代码对应的名称
|
||
|
}
|
||
|
}
|