diff options
author | Ken Moore <ken@pcbsd.org> | 2016-10-05 17:52:52 -0400 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2016-10-05 17:52:52 -0400 |
commit | babd84407a6a3475694268a3966f47a683e4d3cd (patch) | |
tree | 5ffa74d79a98e8324c596bd920f9b9c6ad2b32c2 /src-qt5/desktop-utils/lumina-calculator/mainUI.h | |
parent | Fix up some instability within lumina-fileinfo. (diff) | |
download | lumina-babd84407a6a3475694268a3966f47a683e4d3cd.tar.gz lumina-babd84407a6a3475694268a3966f47a683e4d3cd.tar.bz2 lumina-babd84407a6a3475694268a3966f47a683e4d3cd.zip |
Add a new Lumina project: desktop-utils/lumina-calculator
This is just a very basic calculator at the moment. It still need more buttons/icons/features/etc added to it, but the algorithm and mathematics are already functional for evaluation expressions containing:
Addition/Subtraction (+/-)
Multiplication/Division( * or x, and /)
Order of operations when mixing operations, including expressions within parentheses
Diffstat (limited to 'src-qt5/desktop-utils/lumina-calculator/mainUI.h')
-rw-r--r-- | src-qt5/desktop-utils/lumina-calculator/mainUI.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src-qt5/desktop-utils/lumina-calculator/mainUI.h b/src-qt5/desktop-utils/lumina-calculator/mainUI.h new file mode 100644 index 00000000..96414252 --- /dev/null +++ b/src-qt5/desktop-utils/lumina-calculator/mainUI.h @@ -0,0 +1,33 @@ +//=========================================== +// Lumina Desktop source code +// Copyright (c) 2016, Ken Moore +// Available under the 3-clause BSD license +// See the LICENSE file for full details +//=========================================== +#ifndef _LUMINA_CALCULATOR_MAIN_UI_H +#define _LUMINA_CALCULATOR_MAIN_UI_H + +#include <QMainWindow> +#include <QString> +#include <QChar> + +namespace Ui{ + class mainUI; +}; + +class mainUI : public QMainWindow{ + Q_OBJECT +public: + mainUI(); + ~mainUI(); + +private slots: + void start_calc(); + +private: + Ui::mainUI *ui; + + double performOperation(double LHS, double RHS, QChar symbol); + double strToNumber(QString str); //this is highly-recursive +}; +#endif |