Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions 02_calculator/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -273,6 +274,7 @@ class MainWindow : public QMainWindow
void pressDot() {
if (m_needClearInput) {
setLineText("0");
m_needClearInput = false;
}
QString text = m_line->text();
text += ".";
Expand All @@ -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);
Expand All @@ -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()) {
Expand Down