From fe8be55163096cc1af765841a9b827c540c7500e Mon Sep 17 00:00:00 2001 From: Calcitem Date: Sun, 8 Nov 2020 09:21:06 +0800 Subject: [PATCH] =?UTF-8?q?qt:=20=E8=A7=A3=E5=86=B3=E6=82=94=E6=A3=8B?= =?UTF-8?q?=E6=97=B6=E6=A3=8B=E8=B0=B1=E6=9C=AA=E5=9B=9E=E9=80=80=E7=9D=80?= =?UTF-8?q?=E6=B3=95=E5=B0=B1=E5=9C=A8=E5=90=8E=E9=9D=A2=E9=99=84=E5=8A=A0?= =?UTF-8?q?=E6=96=B0=E7=9D=80=E6=B3=95=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/qt/gamecontroller.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ui/qt/gamecontroller.cpp b/src/ui/qt/gamecontroller.cpp index 31fc9b22..6f10a925 100644 --- a/src/ui/qt/gamecontroller.cpp +++ b/src/ui/qt/gamecontroller.cpp @@ -812,7 +812,13 @@ bool GameController::actionPiece(QPointF pos) if (QMessageBox::Ok == msgBox.exec()) { #endif /* !MOBILE_APP_UI */ - manualListModel.removeRows(currentRow + 1, manualListModel.rowCount() - currentRow - 1); + int rowCount = manualListModel.rowCount(); + int removeCount = rowCount - currentRow - 1; + manualListModel.removeRows(currentRow + 1, rowCount - currentRow - 1); + + for (int i = 0; i < removeCount; i++) { + cmdlist.pop_back(); + } // 如果再决出胜负后悔棋,则重新启动计时 if (position.get_winner() == NOBODY) {