Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PG2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Philipp Pister
PG2
Commits
05ff710b
Commit
05ff710b
authored
1 year ago
by
Philipp Pister
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
faf53013
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Calculator_Update/calculator.h
+76
-0
76 additions, 0 deletions
Calculator_Update/calculator.h
with
76 additions
and
0 deletions
Calculator_Update/calculator.h
0 → 100644
+
76
−
0
View file @
05ff710b
#ifndef CALCULATOR_H
#define CALCULATOR_H
#include
"sinus.h"
#include
<iostream>
#include
<QMainWindow>
#include
<string>
#include
<vector>
QT_BEGIN_NAMESPACE
namespace
Ui
{
class
Calculator
;
}
QT_END_NAMESPACE
class
Calculator
:
public
QMainWindow
{
Q_OBJECT
public:
Calculator
(
QWidget
*
parent
=
nullptr
);
//default
~
Calculator
();
//default
//int& index is a reference to an integer and QString& str is a reference to a QString object
//the functions ausdruck, summand, factor, and zahl are all parsing the 'str' string character by character.
//'references' are used in these function parameters to allow multiple functions to operate on the same data
//QString is a class from the Qt framework which is used for manipulating Unicode strings,
//more efficient and internationalized applications friendly, better as normal std::string
double
ausdruck
(
char
&
zeichen
);
//Das eingelesene Zeichen wird immer
double
summand
(
char
&
zeichen
);
//per Referenz übergeben, damit es
double
factor
(
char
&
zeichen
);
//weitergereicht werden kann, wenn eine
double
zahl
(
char
&
zeichen
);
//Funktion es nicht verarbeiten kann.
void
check
(
char
&
zeichen
);
void
ausgabe
();
char
getZeichen
();
double
calcSin
(
double
result
,
Sinus
::
Modus
defaultModus
);
std
::
string
input
=
""
;
private
slots
:
void
char1
();
void
char2
();
void
char3
();
void
char4
();
void
char5
();
void
char6
();
void
char7
();
void
char8
();
void
char9
();
void
char0
();
void
charDiv
();
void
charSum
();
void
charSub
();
void
charFac
();
void
charFloat
();
void
charKlammerAuf
();
void
charKlammerZu
();
void
berechne
();
void
clearText
();
void
onSinButtonClicked
();
void
onGradButtonClicked
();
void
onRadButtonClicked
();
void
onGonButtonClicked
();
void
onPiButtonClicked
();
void
charKlammerEckig
();
private:
Ui
::
Calculator
*
ui
;
//default
bool
isSinus
=
false
;
double
pi
=
3.14159265
;
std
::
vector
<
std
::
string
>
ausdruecke
;
Sinus
sinus
;
};
#endif // CALCULATOR_H
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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