[0] More...
#include <calculator.h>
Public Member Functions | |
CalculatorUtil (QWidget *parent=nullptr) | |
[0] More... | |
virtual | ~CalculatorUtil () |
[6] More... | |
Private Types | |
enum | { NumDigitButtons = 10 } |
[9] //! [10] More... | |
Private Slots | |
void | digitClicked () |
[7] More... | |
void | unaryOperatorClicked () |
[7] More... | |
void | additiveOperatorClicked () |
[9] More... | |
void | multiplicativeOperatorClicked () |
[17] More... | |
void | equalClicked () |
[18] More... | |
void | pointClicked () |
[20] More... | |
void | changeSignClicked () |
[22] More... | |
void | backspaceClicked () |
[24] More... | |
void | clear () |
[26] More... | |
void | clearAll () |
[28] More... | |
void | clearMemory () |
[30] More... | |
void | readMemory () |
void | setMemory () |
void | addToMemory () |
Private Member Functions | |
Button * | createButton (const QString &text, const char *member) |
[0] More... | |
void | abortOperation () |
[34] More... | |
bool | calculate (double rightOperand, const QString &pendingOperator) |
[36] More... | |
Private Attributes | |
double | sumInMemory |
[2] More... | |
double | sumSoFar |
[3] //! [4] More... | |
double | factorSoFar |
[4] //! [5] More... | |
QString | pendingAdditiveOperator |
[5] //! [6] More... | |
QString | pendingMultiplicativeOperator |
[6] //! [7] More... | |
bool | waitingForOperand |
[7] //! [8] More... | |
QLineEdit * | display |
[8] More... | |
Button * | digitButtons [NumDigitButtons] |
[0]
Definition at line 66 of file calculator.h.
|
private |
|
explicit |
[0]
[0] [1] [1] //! [2]
[2]
[4]
[4]
[5]
[5] //! [6]
Definition at line 60 of file calculator.cpp.
References additiveOperatorClicked(), addToMemory(), backspaceClicked(), changeSignClicked(), clear(), clearAll(), clearMemory(), createButton(), digitButtons, digitClicked(), display, equalClicked(), multiplicativeOperatorClicked(), NumDigitButtons, pointClicked(), readMemory(), setMemory(), and unaryOperatorClicked().
|
virtual |
[6]
Definition at line 150 of file calculator.cpp.
|
private |
[34]
[36]
Definition at line 391 of file calculator.cpp.
References clearAll(), and display.
Referenced by additiveOperatorClicked(), equalClicked(), multiplicativeOperatorClicked(), and unaryOperatorClicked().
|
privateslot |
[9]
[10] [10] //! [11]
[11] //! [12]
[12] //! [13]
[13] //! [14]
[14] //! [15]
[15] //! [16]
[16] //! [17]
Definition at line 201 of file calculator.cpp.
References abortOperation(), calculate(), display, factorSoFar, pendingAdditiveOperator, pendingMultiplicativeOperator, sumSoFar, and waitingForOperand.
Referenced by CalculatorUtil().
|
privateslot |
Definition at line 375 of file calculator.cpp.
References display, equalClicked(), and sumInMemory.
Referenced by CalculatorUtil().
|
privateslot |
[24]
[26]
Definition at line 319 of file calculator.cpp.
References display, and waitingForOperand.
Referenced by CalculatorUtil().
|
private |
[36]
[38]
Definition at line 399 of file calculator.cpp.
References factorSoFar, and sumSoFar.
Referenced by additiveOperatorClicked(), equalClicked(), and multiplicativeOperatorClicked().
|
privateslot |
[22]
[24]
Definition at line 304 of file calculator.cpp.
References display.
Referenced by CalculatorUtil().
|
privateslot |
[26]
[28]
Definition at line 335 of file calculator.cpp.
References display, and waitingForOperand.
Referenced by CalculatorUtil().
|
privateslot |
[28]
[30]
Definition at line 346 of file calculator.cpp.
References display, factorSoFar, pendingAdditiveOperator, pendingMultiplicativeOperator, sumSoFar, and waitingForOperand.
Referenced by abortOperation(), and CalculatorUtil().
|
privateslot |
[30]
[32]
Definition at line 358 of file calculator.cpp.
References sumInMemory.
Referenced by CalculatorUtil().
|
private |
[0]
[32] [34]
[1] [1] //! [2]
Definition at line 382 of file calculator.cpp.
Referenced by CalculatorUtil().
|
privateslot |
[7]
Definition at line 155 of file calculator.cpp.
References display, and waitingForOperand.
Referenced by CalculatorUtil().
|
privateslot |
[18]
[20]
Definition at line 263 of file calculator.cpp.
References abortOperation(), calculate(), display, factorSoFar, pendingAdditiveOperator, pendingMultiplicativeOperator, sumSoFar, and waitingForOperand.
Referenced by addToMemory(), CalculatorUtil(), and setMemory().
|
privateslot |
[17]
[18]
Definition at line 241 of file calculator.cpp.
References abortOperation(), calculate(), display, factorSoFar, pendingMultiplicativeOperator, and waitingForOperand.
Referenced by CalculatorUtil().
|
privateslot |
[20]
[22]
Definition at line 293 of file calculator.cpp.
References display, and waitingForOperand.
Referenced by CalculatorUtil().
|
privateslot |
Definition at line 363 of file calculator.cpp.
References display, sumInMemory, and waitingForOperand.
Referenced by CalculatorUtil().
|
privateslot |
Definition at line 369 of file calculator.cpp.
References display, equalClicked(), and sumInMemory.
Referenced by CalculatorUtil().
|
privateslot |
[7]
[8] [8] //! [9]
Definition at line 171 of file calculator.cpp.
References abortOperation(), display, and waitingForOperand.
Referenced by CalculatorUtil().
|
private |
Definition at line 118 of file calculator.h.
Referenced by CalculatorUtil().
|
private |
[8]
[9]
Definition at line 114 of file calculator.h.
Referenced by abortOperation(), additiveOperatorClicked(), addToMemory(), backspaceClicked(), CalculatorUtil(), changeSignClicked(), clear(), clearAll(), digitClicked(), equalClicked(), multiplicativeOperatorClicked(), pointClicked(), readMemory(), setMemory(), and unaryOperatorClicked().
|
private |
[4] //! [5]
Definition at line 104 of file calculator.h.
Referenced by additiveOperatorClicked(), calculate(), clearAll(), equalClicked(), and multiplicativeOperatorClicked().
|
private |
[5] //! [6]
Definition at line 106 of file calculator.h.
Referenced by additiveOperatorClicked(), clearAll(), and equalClicked().
|
private |
[6] //! [7]
Definition at line 108 of file calculator.h.
Referenced by additiveOperatorClicked(), clearAll(), equalClicked(), and multiplicativeOperatorClicked().
|
private |
[2]
[3]
Definition at line 100 of file calculator.h.
Referenced by addToMemory(), clearMemory(), readMemory(), and setMemory().
|
private |
[3] //! [4]
Definition at line 102 of file calculator.h.
Referenced by additiveOperatorClicked(), calculate(), clearAll(), and equalClicked().
|
private |
[7] //! [8]
Definition at line 110 of file calculator.h.
Referenced by additiveOperatorClicked(), backspaceClicked(), clear(), clearAll(), digitClicked(), equalClicked(), multiplicativeOperatorClicked(), pointClicked(), readMemory(), and unaryOperatorClicked().