diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-01-13 15:48:44 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-13 22:46:50 +0100 |
commit | 882bf3475c8926abe62ed71e6719458b024caac0 (patch) | |
tree | f227c1c660776da1ece9149b1c9e3ca5b27d8687 /examples/widgets/widgets/calculator/calculator.cpp | |
parent | 81157d23749f6ee1feef35a04fa9cc989ebc01eb (diff) |
expand tabs and related whitespace fixes in *.{cpp,h,qdoc}
the diff -w for this commit is empty.
Started-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'examples/widgets/widgets/calculator/calculator.cpp')
-rw-r--r-- | examples/widgets/widgets/calculator/calculator.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/examples/widgets/widgets/calculator/calculator.cpp b/examples/widgets/widgets/calculator/calculator.cpp index 5b6b69ba03..bb3836bd70 100644 --- a/examples/widgets/widgets/calculator/calculator.cpp +++ b/examples/widgets/widgets/calculator/calculator.cpp @@ -69,7 +69,7 @@ Calculator::Calculator(QWidget *parent) //! [4] for (int i = 0; i < NumDigitButtons; ++i) { - digitButtons[i] = createButton(QString::number(i), SLOT(digitClicked())); + digitButtons[i] = createButton(QString::number(i), SLOT(digitClicked())); } Button *pointButton = createButton(tr("."), SLOT(pointClicked())); @@ -144,7 +144,7 @@ void Calculator::digitClicked() if (waitingForOperand) { display->clear(); - waitingForOperand = false; + waitingForOperand = false; } display->setText(display->text() + QString::number(digitValue)); } @@ -169,8 +169,8 @@ void Calculator::unaryOperatorClicked() result = pow(operand, 2.0); } else if (clickedOperator == tr("1/x")) { if (operand == 0.0) { - abortOperation(); - return; + abortOperation(); + return; } result = 1.0 / operand; } @@ -192,7 +192,7 @@ void Calculator::additiveOperatorClicked() //! [12] //! [13] if (!calculate(operand, pendingMultiplicativeOperator)) { abortOperation(); - return; + return; } display->setText(QString::number(factorSoFar)); operand = factorSoFar; @@ -205,7 +205,7 @@ void Calculator::additiveOperatorClicked() //! [14] //! [15] if (!calculate(operand, pendingAdditiveOperator)) { abortOperation(); - return; + return; } display->setText(QString::number(sumSoFar)); } else { @@ -229,7 +229,7 @@ void Calculator::multiplicativeOperatorClicked() if (!pendingMultiplicativeOperator.isEmpty()) { if (!calculate(operand, pendingMultiplicativeOperator)) { abortOperation(); - return; + return; } display->setText(QString::number(factorSoFar)); } else { @@ -249,7 +249,7 @@ void Calculator::equalClicked() if (!pendingMultiplicativeOperator.isEmpty()) { if (!calculate(operand, pendingMultiplicativeOperator)) { abortOperation(); - return; + return; } operand = factorSoFar; factorSoFar = 0.0; @@ -258,7 +258,7 @@ void Calculator::equalClicked() if (!pendingAdditiveOperator.isEmpty()) { if (!calculate(operand, pendingAdditiveOperator)) { abortOperation(); - return; + return; } pendingAdditiveOperator.clear(); } else { @@ -387,9 +387,9 @@ bool Calculator::calculate(double rightOperand, const QString &pendingOperator) } else if (pendingOperator == tr("\303\227")) { factorSoFar *= rightOperand; } else if (pendingOperator == tr("\303\267")) { - if (rightOperand == 0.0) - return false; - factorSoFar /= rightOperand; + if (rightOperand == 0.0) + return false; + factorSoFar /= rightOperand; } return true; } |