ui: 界面上显示总盘数
This commit is contained in:
parent
f830f8bb8b
commit
9d715fc6a0
|
@ -572,6 +572,41 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelGamesPlayed">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>黑体</family>
|
||||||
|
<pointsize>9</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>盘数:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLCDNumber" name="scoreLcdNumber_GamesPlayed">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="layoutDirection">
|
||||||
|
<enum>Qt::LeftToRight</enum>
|
||||||
|
</property>
|
||||||
|
<property name="smallDecimalPoint">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="digitCount">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<property name="value" stdset="0">
|
||||||
|
<double>0.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="labelScore">
|
<widget class="QLabel" name="labelScore">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
|
|
|
@ -249,6 +249,7 @@ void GameController::gameReset()
|
||||||
emit statusBarChanged(message);
|
emit statusBarChanged(message);
|
||||||
|
|
||||||
// 更新比分 LCD 显示
|
// 更新比分 LCD 显示
|
||||||
|
emit nGamesPlayedChanged(QString::number(state.nPlayed, 10));
|
||||||
emit score1Changed(QString::number(state.score[BLACK], 10));
|
emit score1Changed(QString::number(state.score[BLACK], 10));
|
||||||
emit score2Changed(QString::number(state.score[WHITE], 10));
|
emit score2Changed(QString::number(state.score[WHITE], 10));
|
||||||
emit scoreDrawChanged(QString::number(state.score_draw, 10));
|
emit scoreDrawChanged(QString::number(state.score_draw, 10));
|
||||||
|
|
|
@ -134,6 +134,9 @@ public:
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
// 总盘数改变的信号
|
||||||
|
void nGamesPlayedChanged(const QString &score);
|
||||||
|
|
||||||
// 玩家1(先手)赢盘数改变的信号
|
// 玩家1(先手)赢盘数改变的信号
|
||||||
void score1Changed(const QString &score);
|
void score1Changed(const QString &score);
|
||||||
|
|
||||||
|
|
|
@ -271,6 +271,10 @@ void MillGameWindow::initialize()
|
||||||
|
|
||||||
// 关联控制器的信号和主窗口控件的槽
|
// 关联控制器的信号和主窗口控件的槽
|
||||||
|
|
||||||
|
// 更新LCD,显示总盘数
|
||||||
|
connect(gameController, SIGNAL(nGamesPlayedChanged(QString)),
|
||||||
|
ui.scoreLcdNumber_GamesPlayed, SLOT(display(QString)));
|
||||||
|
|
||||||
// 更新LCD,显示玩家1赢盘数
|
// 更新LCD,显示玩家1赢盘数
|
||||||
connect(gameController, SIGNAL(score1Changed(QString)),
|
connect(gameController, SIGNAL(score1Changed(QString)),
|
||||||
ui.scoreLcdNumber_1, SLOT(display(QString)));
|
ui.scoreLcdNumber_1, SLOT(display(QString)));
|
||||||
|
|
Loading…
Reference in New Issue