diff --git a/02_calculator/main.cpp b/02_calculator/main.cpp index 34b1a07..b4a23fc 100644 --- a/02_calculator/main.cpp +++ b/02_calculator/main.cpp @@ -258,6 +258,7 @@ class MainWindow : public QMainWindow void pressSign() { if (m_needClearInput) { setLineText("0"); + m_needClearInput = false; } QString text = m_line->text(); if (!text.isEmpty()) { @@ -273,6 +274,7 @@ class MainWindow : public QMainWindow void pressDot() { if (m_needClearInput) { setLineText("0"); + m_needClearInput = false; } QString text = m_line->text(); text += "."; @@ -282,6 +284,7 @@ class MainWindow : public QMainWindow void pressNumber(int i) { if (m_needClearInput) { setLineText("0"); + m_needClearInput = false; } QString text = m_line->text(); text += QString::number(i); @@ -291,6 +294,7 @@ class MainWindow : public QMainWindow void pressBackspace() { if (m_needClearInput) { setLineText("0"); + m_needClearInput = false; } QString text = m_line->text(); if (!text.isEmpty()) {