#include "Competitor.h" bool Competitor::setCompetitor(const QJsonObject &competitor) { if (!competitor.contains("code") || !competitor.contains("name") || !competitor.contains("m_noc")) { throw invalid_argument("Not a competitor object."); } setCode(competitor["code"].toInt()); setName(competitor["name"].toString()); setNOC(competitor["m_noc"].toString()); return true; } bool Competitor::setCompetitor(const Competitor &competitor) { setCode(competitor.m_code); setName(competitor.m_name); setNOC(competitor.m_noc); return true; }