#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."); } this->m_code = competitor["code"].toInt(); this->m_name = competitor["name"].toString(); this->m_noc = competitor["m_noc"].toString(); return true; }