You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
1.2 KiB
C++

#include "sale.h"
#include <define.h>
QX_REGISTER_CPP_CAMP(Sale)
namespace qx {
template<> void register_class(QxClass<Sale>& t) {
t.setName("Sale");
t.id(&Sale::m_id, "id");
t.data(&Sale::m_sale, "sale");
t.data(&Sale::m_fixed, "fixed");
t.data(&Sale::m_description, "description");
}
}
Sale::Sale(QObject *parent) : ComboItem(parent)
{
m_id = 0;
m_sale = 0;
m_fixed = false;
}
long Sale::id() const
{
return m_id;
}
void Sale::setId(long id)
{
m_id = id;
}
QDecDouble Sale::sale() const
{
return TO_DEC(m_sale);
}
void Sale::setSale(QDecDouble sale)
{
m_sale = FROM_DEC(sale);
}
bool Sale::fixed() const
{
return m_fixed;
}
void Sale::setFixed(bool fixed)
{
m_fixed = fixed;
}
QString Sale::description() const
{
return m_description;
}
void Sale::setDescription(const QString &description)
{
m_description = description;
}
bool Sale::eq(ComboItem *other)
{
Sale *sale = qobject_cast<Sale*>(other);
if (sale == NULL)
{
return false;
}
return this->m_id == sale->m_id && this->m_sale == sale->m_sale && this->m_fixed == sale->m_fixed;
}
QString Sale::toString()
{
return m_description;
}