#include "Competitor.h" bool Competitor::setCompetitor(const QJsonObject &competitor) { if (!competitor.contains("code") || !competitor.contains("name") || !competitor.contains("noc")) { throw invalid_argument("Not a competitor object."); } this->code = competitor["code"].toString(); this->name = competitor["name"].toString(); this->noc = competitor["noc"].toString(); return true; }