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.

108 lines
2.0 KiB
C++

#include "countrydata.h"
QX_REGISTER_CPP_COUNTRY(CountryData)
namespace qx {
template<> void register_class(QxClass<CountryData>& t) {
t.setName("CountryData");
t.id(&CountryData::m_id, "id");
t.data(&CountryData::m_code2, "code2");
t.data(&CountryData::m_code3, "code3");
t.data(&CountryData::m_czechFullName, "czechFullName");
t.data(&CountryData::m_czechName, "czechName");
t.data(&CountryData::m_englishFullName, "englishFullName");
t.data(&CountryData::m_englishName, "englishName");
}
}
CountryData::CountryData(QObject *parent) : ComboItem(parent)
{
}
long CountryData::id() const
{
return m_id;
}
void CountryData::setId(long id)
{
m_id = id;
}
QString CountryData::code2() const
{
return m_code2;
}
void CountryData::setCode2(const QString &code2)
{
m_code2 = code2;
}
QString CountryData::code3() const
{
return m_code3;
}
void CountryData::setCode3(const QString &code3)
{
m_code3 = code3;
}
QString CountryData::czechFullName() const
{
return m_czechFullName;
}
void CountryData::setCzechFullName(const QString &czechFullName)
{
m_czechFullName = czechFullName;
}
QString CountryData::czechName() const
{
return m_czechName;
}
void CountryData::setCzechName(const QString &czechName)
{
m_czechName = czechName;
}
QString CountryData::englishFullName() const
{
return m_englishFullName;
}
void CountryData::setEnglishFullName(const QString &englishFullName)
{
m_englishFullName = englishFullName;
}
QString CountryData::englishName() const
{
return m_englishName;
}
void CountryData::setEnglishName(const QString &englishName)
{
m_englishName = englishName;
}
bool CountryData::eq(ComboItem *other)
{
CountryData *obj = qobject_cast<CountryData*>(other);
if (obj == nullptr)
{
return false;
}
return this == obj || (m_id == obj->m_id && m_code2 == obj->m_code2 && m_code3 == obj->m_code3);
}
QString CountryData::toString()
{
return m_czechName + " (" + m_code3 + ")";
}