IntelliPhoto 0.5

IntelliColorPicker.cpp
Go to the documentation of this file.
1 #include "IntelliColorPicker.h"
2 #include "QDebug"
3
4 IntelliColorPicker::IntelliColorPicker(PaintingArea* Area)
5 : IntelliTool(Area){
6 firstColor = {255,0,0,255};
7 secondColor = {0,0,255,255};
8 }
9
10 IntelliColorPicker::~IntelliColorPicker(){
11
12 }
13
14 void IntelliColorPicker::getColorbar(int firstOrSecondColor = 1){
15 QString Titel;
16 QColor newColor;
17 if(firstOrSecondColor == 1) {
18 Titel = "Choose first Color";
19 newColor = QColorDialog::getColor(this->firstColor,nullptr,Titel);
20 this->firstColor = newColor;
21 qDebug() << "Firstcolor" << this->firstColor;
22 }
23 else{
24 Titel = "Choose second Color";
25 newColor = QColorDialog::getColor(this->secondColor,nullptr,Titel);
26 this->secondColor = newColor;
27 }
28 }
29
30 QColor IntelliColorPicker::getFirstColor(){
31 return firstColor;
32 }
33
34 QColor IntelliColorPicker::getSecondColor(){
35 return secondColor;
36 }
IntelliColorPicker::~IntelliColorPicker
virtual ~IntelliColorPicker()
IntelliColorPicker destructor clears up his used memory, if there is some.
Definition: IntelliColorPicker.cpp:8
IntelliColorPicker::getSecondColor
QColor getSecondColor()
A function to read the secondary selected color.
Definition: IntelliColorPicker.cpp:20
PaintingArea
The PaintingArea class manages the methods and stores information about the current painting area,...
Definition: PaintingArea.h:36
IntelliColorPicker.h
IntelliTool
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:13
IntelliColorPicker::getFirstColor
QColor getFirstColor()
A function to read the primary selected color.
Definition: IntelliColorPicker.cpp:16
IntelliColorPicker::IntelliColorPicker
IntelliColorPicker()
IntelliColorPicker constructor, setting 2 preset colors, be careful, theese color may change in produ...
Definition: IntelliColorPicker.cpp:3