Logo Search packages:      
Sourcecode: qt-at-spi version File versions  Download package

bool Calculator::calculate ( double  rightOperand,
const QString &  pendingOperator 
) [private]

[36]

[38]

Definition at line 368 of file calculator.cpp.

References factorSoFar, and sumSoFar.

Referenced by additiveOperatorClicked(), equalClicked(), and multiplicativeOperatorClicked().

{
    if (pendingOperator == tr("+")) {
        sumSoFar += rightOperand;
    } else if (pendingOperator == tr("-")) {
        sumSoFar -= rightOperand;
    } else if (pendingOperator == tr("\327")) {
        factorSoFar *= rightOperand;
    } else if (pendingOperator == tr("\367")) {
      if (rightOperand == 0.0)
          return false;
      factorSoFar /= rightOperand;
    }
    return true;
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index