void TeamSetupPage::applyProfile() { if (!activeProfile.getLogoPath().isEmpty()) { nameLine.setText(activeProfile.getFullName()); QImage swatch(activeProfile.getSwatchPath()); School s (activeProfile,swatch,QPixmap::fromImage(MiamiAllAccessHockey::getTrimmedLogo(activeProfile.getLogoPath()))); QColor awayColor; switch (swatchSelector->currentIndex()) { case 0: awayColor = s.getPrimaryColor(); break; default: awayColor = s.getSecondaryColor(); } colorPrev.fill(awayColor); colorBox->setPixmap(colorPrev); if (!isHome) { MiamiAllAccessHockey::awaySchool = s; logoPrev = MiamiAllAccessHockey::awaySchool.getLogo().scaledToWidth(50); } else { MiamiAllAccessHockey::homeSchool = s; logoPrev = MiamiAllAccessHockey::homeSchool.getLogo().scaledToWidth(50); } logoBox.setPixmap(logoPrev); shortLine.setText(activeProfile.getShortName()); } }
int main() { School SCU; SCU.name = "Santa Clara Universiy"; SCU.intro(); School CRCE; CRCE.name = "Fr. Agnel Bandra"; CRCE.intro(); return 0; }
void System::retrieveSchools(const char * file) { ifstream inFile; inFile.open(file); if (!inFile) { cerr << "Unable to open file " << file; exit(1); // call system to stop } string line; int idNo=0; int X=0; int Y=0; while(getline(inFile, line)) { stringstream linestream(line); string data; linestream >> idNo; getline(linestream, data, ';'); // read up-to the first ; (discard ;). linestream >> X; getline(linestream, data, ';'); // read up-to the first ; (discard ;). linestream >> Y; Coordenate* c = existsCoord(X,Y); if(c == NULL) { cerr << "Invalid Coordenates for Company. Inexistence in Coordenates List\n"; exit(1); } School* s = new School(); s->setCoord(c); this->schools.push_back(s); } inFile.close(); }
QList<SchoolClass> SchoolClass::classesInSchool(School school) { QList<SchoolClass> res; QSqlQuery query; query.prepare("SELECT school_class_key, class_label, school_fk " "FROM school_class " "WHERE school_fk = :key"); query.bindValue(":key", school.getKey().toString()); if (!query.exec()) { qDebug() << "SchoolClass::classesInSchool SQL error: " << query.lastError().driverText() << " school key: " << school.getKey().toString(); } while(query.next()) { SchoolClass schoolClass(QUuid(query.value("school_class_key").toString()), query.value("class_label").toString(), school.getKey()); res.append(schoolClass); } return res; }
bool operator==(const School &school1, const School &school2) { return school1.GetName() == school2.GetName(); }
bool alpha_by_school_name(const School& school1, const School& school2){ return (school1.GetName()<school2.GetName()); }