18 Star 375 Fork 79

ibc-dabing / Landlords

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
scorepanel.cpp 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
kevin 提交于 2021-12-07 23:24 . add file
#include "scorepanel.h"
#include "ui_scorepanel.h"
const QString MYCOLOR[] = {"black", "white", "red", "blue", "green"};
ScorePanel::ScorePanel(QWidget *parent) :
QWidget(parent),
ui(new Ui::ScorePanel)
{
ui->setupUi(this);
m_list << ui->meScore << ui->leftScore << ui->rightScore
<< ui->meTitle << ui->leftTitle << ui->rightTitle
<< ui->score1 << ui->score2 << ui->score3;
}
ScorePanel::~ScorePanel()
{
delete ui;
}
void ScorePanel::setScores(int left, int right, int user)
{
ui->leftScore->setText(QString::number(left));
ui->rightScore->setText(QString::number(right));
ui->meScore->setText(QString::number(user));
}
void ScorePanel::setMyFontSize(int point)
{
QFont font("微软雅黑", point, QFont::Bold);
for(int i=0; i<m_list.size(); ++i)
{
m_list[i]->setFont(font);
}
}
void ScorePanel::setMyFontColor(FontColor color)
{
QString style = QString("QLabel{color:%1}").arg(MYCOLOR[color]);
for(int i=0; i<m_list.size(); ++i)
{
m_list[i]->setStyleSheet(style);
}
}
1
https://gitee.com/subingwen/landlords.git
git@gitee.com:subingwen/landlords.git
subingwen
landlords
Landlords
master

搜索帮助