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

void Calculator::equalClicked (  ) [private, slot]

[18]

[20]

Definition at line 232 of file calculator.cpp.

References abortOperation(), calculate(), display, factorSoFar, pendingAdditiveOperator, pendingMultiplicativeOperator, sumSoFar, and waitingForOperand.

Referenced by Calculator().

{
    double operand = display->text().toDouble();

    if (!pendingMultiplicativeOperator.isEmpty()) {
        if (!calculate(operand, pendingMultiplicativeOperator)) {
            abortOperation();
          return;
        }
        operand = factorSoFar;
        factorSoFar = 0.0;
        pendingMultiplicativeOperator.clear();
    }
    if (!pendingAdditiveOperator.isEmpty()) {
        if (!calculate(operand, pendingAdditiveOperator)) {
            abortOperation();
          return;
        }
        pendingAdditiveOperator.clear();
    } else {
        sumSoFar = operand;
    }

    display->setText(QString::number(sumSoFar));
    sumSoFar = 0.0;
    waitingForOperand = true;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index