diff --git a/gamewindow.ui b/gamewindow.ui index 5a9344b1..bb17ae18 100644 --- a/gamewindow.ui +++ b/gamewindow.ui @@ -572,6 +572,41 @@ + + + + + 黑体 + 9 + + + + 盘数: + + + + + + + + 0 + 0 + + + + Qt::LeftToRight + + + false + + + 5 + + + 0.000000000000000 + + + diff --git a/src/ui/qt/gamecontroller.cpp b/src/ui/qt/gamecontroller.cpp index f633a470..0e46593c 100644 --- a/src/ui/qt/gamecontroller.cpp +++ b/src/ui/qt/gamecontroller.cpp @@ -249,6 +249,7 @@ void GameController::gameReset() emit statusBarChanged(message); // 更新比分 LCD 显示 + emit nGamesPlayedChanged(QString::number(state.nPlayed, 10)); emit score1Changed(QString::number(state.score[BLACK], 10)); emit score2Changed(QString::number(state.score[WHITE], 10)); emit scoreDrawChanged(QString::number(state.score_draw, 10)); diff --git a/src/ui/qt/gamecontroller.h b/src/ui/qt/gamecontroller.h index 2a5ac46c..57a417ad 100644 --- a/src/ui/qt/gamecontroller.h +++ b/src/ui/qt/gamecontroller.h @@ -134,6 +134,9 @@ public: signals: + // 总盘数改变的信号 + void nGamesPlayedChanged(const QString &score); + // 玩家1(先手)赢盘数改变的信号 void score1Changed(const QString &score); diff --git a/src/ui/qt/gamewindow.cpp b/src/ui/qt/gamewindow.cpp index cbc2715b..3a843421 100644 --- a/src/ui/qt/gamewindow.cpp +++ b/src/ui/qt/gamewindow.cpp @@ -271,6 +271,10 @@ void MillGameWindow::initialize() // 关联控制器的信号和主窗口控件的槽 + // 更新LCD,显示总盘数 + connect(gameController, SIGNAL(nGamesPlayedChanged(QString)), + ui.scoreLcdNumber_GamesPlayed, SLOT(display(QString))); + // 更新LCD,显示玩家1赢盘数 connect(gameController, SIGNAL(score1Changed(QString)), ui.scoreLcdNumber_1, SLOT(display(QString)));