Listing 1. Slots
public slots:
/** calls repaint() on all views connected to the
* document object and is called by the view by
* which the document has been changed.
* As this view normally repaints itself, it is
* excluded from the paintEvent.
*/
void slotUpdateAllViews(KalculateView *sender);
/** All of the calculator functions, a method for
* each actual button a real calculator would
* have. Instead of having some setNum(int)
* function, I used this design to not only make
* the object type safe, but type agnostic. I
* prefer this because now we can change the
* back end anytime without breaking things.
*/
void pressZero();
void pressOne();
void pressTwo();
void pressThree();
void pressFour();
void pressFive();
void pressSix();
void pressSeven();
void pressEight();
void pressNine();
void pressPlus();
void pressMinus();
void pressTimes();
void pressDivide();
void pressToggleSign();
void pressEquals();
void pressDecimal();
void pressClear();
Copyright © 1994 - 2018 Linux Journal. All rights reserved.