summaryrefslogtreecommitdiff
path: root/noncore/tools/calculator/calculatorimpl.h
Unidiff
Diffstat (limited to 'noncore/tools/calculator/calculatorimpl.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/calculator/calculatorimpl.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/tools/calculator/calculatorimpl.h b/noncore/tools/calculator/calculatorimpl.h
index f0180c9..06ec829 100644
--- a/noncore/tools/calculator/calculatorimpl.h
+++ b/noncore/tools/calculator/calculatorimpl.h
@@ -52,49 +52,51 @@ enum Operation {
52 oChSign 52 oChSign
53}; 53};
54 54
55// states 55// states
56#define sStart 0 56#define sStart 0
57#define sNewNumber 1 57#define sNewNumber 1
58#define sError 2 58#define sError 2
59 59
60struct Op 60struct Op
61{ 61{
62 Op() { number = 0; operation = oNop; } 62 Op() { number = 0; operation = oNop; }
63 Op( double num, Operation op ) 63 Op( double num, Operation op )
64 { number = num; operation = op; } 64 { number = num; operation = op; }
65 double number; 65 double number;
66 Operation operation; 66 Operation operation;
67}; 67};
68 68
69class QLabel; 69class QLabel;
70class CalculatorImpl : public Calculator 70class CalculatorImpl : public Calculator
71{ 71{
72 Q_OBJECT 72 Q_OBJECT
73 73
74public: 74public:
75 CalculatorImpl( QWidget * parent = 0, const char * name = 0, 75 CalculatorImpl( QWidget * parent = 0, const char * name = 0,
76 WFlags f = 0 ); 76 WFlags f = 0 );
77 static QString appName() { return QString::fromLatin1("calculator"); }
78
77 79
78public slots: 80public slots:
79 void command_buttons(int); 81 void command_buttons(int);
80 void enterNumber(int i); 82 void enterNumber(int i);
81 void std_buttons(int); 83 void std_buttons(int);
82 void std_funcs(int); 84 void std_funcs(int);
83 void do_convert(int); 85 void do_convert(int);
84 void function_button(int); 86 void function_button(int);
85 87
86protected: 88protected:
87 virtual bool eventFilter( QObject *o, QEvent *e ); 89 virtual bool eventFilter( QObject *o, QEvent *e );
88 90
89private: 91private:
90 void clear(); 92 void clear();
91 93
92 void reset_conv(); 94 void reset_conv();
93 95
94 void processStack( int op ); 96 void processStack( int op );
95 97
96 QValueStack<Op> operationStack; 98 QValueStack<Op> operationStack;
97 int state; 99 int state;
98 100
99 double acc, num, mem; 101 double acc, num, mem;
100 int numDecimals; 102 int numDecimals;