Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Екатерина Спорова
Laba2
Commits
c6b801d0
Commit
c6b801d0
authored
4 years ago
by
Екатерина Спорова
Browse files
Options
Download
Patches
Plain Diff
Add new file
parent
66d13636
master
No related merge requests found
Pipeline
#881
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Calc.h
+54
-0
Calc.h
with
54 additions
and
0 deletions
+54
-0
Calc.h
0 → 100644
+
54
−
0
View file @
c6b801d0
#ifndef CALC_H
#define CALC_H
#include
<QWidget>
#include
<QStack>
class
QLCDNumber
;
class
QPushButton
;
class
QGridLayout
;
class
QRadioButton
;
class
QHBoxLayout
;
class
Calculator
:
public
QWidget
{
Q_OBJECT
public:
Calculator
(
QWidget
*
parent
=
nullptr
);
~
Calculator
();
void
calc
();
private:
QLCDNumber
*
f_lcdNum
;
QRadioButton
*
f_radioBtnCasual
;
QRadioButton
*
f_radioBtnSci
;
QStack
<
QString
>
f_operStack
;
QString
f_currentNum
;
bool
f_if_currNumChangable
;
QGridLayout
*
f_BtnLayoutCasual
;
QGridLayout
*
f_BtnLayoutSciExtr
;
QWidget
*
f_BtnLayoutSciExtrWidget
;
QWidget
*
f_BtnLayoutCasualExtrWidget
;
QHBoxLayout
*
f_HBoxBtnLayout
;
QGridLayout
*
MainLayout
;
const
double
PI
=
3.1415926535
;
const
QVector
<
QString
>
NumND
=
{
"e"
,
"pi"
};
const
QVector
<
QString
>
UnOp
=
{
"rev"
,
"sqr"
,
"sqrt"
,
"-x"
,
"sin"
,
"cos"
,
"tan"
,
"tanh"
,
"sinh"
,
"cosh"
,
"ln"
,
"exp"
,
"n!"
,
"cubic root"
,
"cubic sqr"
};
const
QVector
<
QString
>
OpToCountimmediately
=
{
"log"
,
"ysqr"
,
"ysqrt"
};
const
QVector
<
QString
>
SumOp
=
{
"+"
,
"-"
};
QPushButton
*
createButton
(
const
QString
&
p_str
,
size_t
p_horz
,
size_t
p_vert
);
public
slots
:
void
slotButtonClicked
();
void
slotHideSci
(
bool
);
void
slotShowSci
(
bool
);
};
#endif // CALCULATOR_H
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets