示例#1
0
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());
    }
}