Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
software-engineer-Image-Editor
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
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiangyu Tong
software-engineer-Image-Editor
Commits
16fbaccc
Commit
16fbaccc
authored
5 years ago
by
passscod
Browse files
Options
Downloads
Patches
Plain Diff
stop
parent
400bcfe4
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Implementation/GUI/DrawDock.cpp
+3
-68
3 additions, 68 deletions
Implementation/GUI/DrawDock.cpp
Implementation/GUI/imageviewer.cpp
+1
-4
1 addition, 4 deletions
Implementation/GUI/imageviewer.cpp
with
4 additions
and
72 deletions
Implementation/GUI/DrawDock.cpp
+
3
−
68
View file @
16fbaccc
...
@@ -5,14 +5,9 @@ DrawDock::DrawDock(InteractionTool *interaction){
...
@@ -5,14 +5,9 @@ DrawDock::DrawDock(InteractionTool *interaction){
colorButton
=
new
QPushButton
();
colorButton
=
new
QPushButton
();
for
(
int
i
=
0
;
i
<
256
;
i
++
){
for
(
int
i
=
0
;
i
<
256
;
i
++
){
colorVect
.
append
(
QColor
(
255
,
255
,
255
,
255
).
rgba
());
colorVect
.
append
(
QColor
(
255
,
255
,
255
,
255
).
rgba
());
//px.fill(colorVect[i]);
//colorButtons[i]->setIcon(px);
QString
str
,
str2
;
QString
str
,
str2
;
QPixmap
px
(
20
,
20
);
QPixmap
px
(
20
,
20
);
//str.append(qRed(colorVect[i]));
//str.append(";");
str
.
sprintf
(
"padding:0px;background-color: qlineargradient(stop:0 #%02x%02x%02x);"
,
qRed
(
colorVect
[
i
]),
qGreen
(
colorVect
[
i
]),
qBlue
(
colorVect
[
i
]));
str
.
sprintf
(
"padding:0px;background-color: qlineargradient(stop:0 #%02x%02x%02x);"
,
qRed
(
colorVect
[
i
]),
qGreen
(
colorVect
[
i
]),
qBlue
(
colorVect
[
i
]));
//printf("background-color: #%02x%02x%02x;\n",qRed(colorVect[i]),qGreen(colorVect[i]),qBlue(colorVect[i]));
if
(
i
==
drawColorIndex
){
if
(
i
==
drawColorIndex
){
QPixmap
px
(
40
,
20
);
QPixmap
px
(
40
,
20
);
px
.
fill
(
QColor
(
0
,
0
,
0
,
0
));
px
.
fill
(
QColor
(
0
,
0
,
0
,
0
));
...
@@ -31,25 +26,16 @@ DrawDock::DrawDock(InteractionTool *interaction){
...
@@ -31,25 +26,16 @@ DrawDock::DrawDock(InteractionTool *interaction){
p
.
fillRect
(
30
,
0
,
10
,
10
,
*
br2
);
p
.
fillRect
(
30
,
0
,
10
,
10
,
*
br2
);
p
.
end
();
p
.
end
();
colorButton
->
setStyleSheet
(
str
);
colorButton
->
setStyleSheet
(
str
);
//colorButton->setIcon(px);
}
}
//connect(colorButtons[i], SIGNAL(clicked()),colorButtons[i], SLOT(toggle()));
str2
.
sprintf
(
"Color %d"
,
i
);
str2
.
sprintf
(
"Color %d"
,
i
);
px
.
fill
(
colorVect
[
i
]);
px
.
fill
(
colorVect
[
i
]);
//QAction *act = new QAction(px,str);
//act->setCheckable(true);
//connect(act, SIGNAL(clicked()),this, SLOT(setDrawColor()));
colorMenu
->
addAction
(
px
,
str2
,
this
,
&
DrawDock
::
setDrawColor
);
colorMenu
->
addAction
(
px
,
str2
,
this
,
&
DrawDock
::
setDrawColor
);
}
}
colorAct
=
colorMenu
->
actions
();
colorAct
=
colorMenu
->
actions
();
for
(
int
i
=
0
;
i
<
256
;
i
++
)
{
for
(
int
i
=
0
;
i
<
256
;
i
++
)
{
colorAct
[
i
]
->
setCheckable
(
true
);
colorAct
[
i
]
->
setCheckable
(
true
);
//connect(act[i], SIGNAL(toggled()),this, SLOT(setDrawColor()));
}
}
colorButton
->
setMenu
(
colorMenu
);
colorButton
->
setMenu
(
colorMenu
);
drawSpinbox
=
new
QSpinBox
();
drawSpinbox
=
new
QSpinBox
();
drawSpinbox
->
setValue
(
3
);
drawSpinbox
->
setValue
(
3
);
connect
(
drawSpinbox
,
QOverload
<
int
>::
of
(
&
QSpinBox
::
valueChanged
),
this
,
&
DrawDock
::
setWidth
);
connect
(
drawSpinbox
,
QOverload
<
int
>::
of
(
&
QSpinBox
::
valueChanged
),
this
,
&
DrawDock
::
setWidth
);
...
@@ -57,13 +43,11 @@ DrawDock::DrawDock(InteractionTool *interaction){
...
@@ -57,13 +43,11 @@ DrawDock::DrawDock(InteractionTool *interaction){
drawSlider
->
setRange
(
1
,
99
);
drawSlider
->
setRange
(
1
,
99
);
drawSlider
->
setValue
(
3
);
drawSlider
->
setValue
(
3
);
connect
(
drawSlider
,
QOverload
<
int
>::
of
(
&
QSlider
::
valueChanged
),
this
,
&
DrawDock
::
setWidth
);
connect
(
drawSlider
,
QOverload
<
int
>::
of
(
&
QSlider
::
valueChanged
),
this
,
&
DrawDock
::
setWidth
);
drawStartButton
=
new
QPushButton
(
"Start"
);
drawStartButton
=
new
QPushButton
(
"Start"
);
drawStartButton
->
setCheckable
(
true
);
drawStartButton
->
setCheckable
(
true
);
connect
(
drawStartButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
startDraw
()));
connect
(
drawStartButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
startDraw
()));
ignoreShaped
=
new
QCheckBox
(
"Ignore Shape"
);
ignoreShaped
=
new
QCheckBox
(
"Ignore Shape"
);
interactionTool
=
interaction
;
interactionTool
=
interaction
;
//createDrawDock();
param
=
nullptr
;
param
=
nullptr
;
}
}
DrawDock
::~
DrawDock
(){
DrawDock
::~
DrawDock
(){
...
@@ -134,7 +118,6 @@ bool DrawDock::mouseEvent(QMouseEvent *event, eventType_e type, int w1, int w2,
...
@@ -134,7 +118,6 @@ bool DrawDock::mouseEvent(QMouseEvent *event, eventType_e type, int w1, int w2,
param
->
endPoint
=
event
->
pos
()
-
QPoint
(
w1
-
w2
,
h1
-
h2
);
param
->
endPoint
=
event
->
pos
()
-
QPoint
(
w1
-
w2
,
h1
-
h2
);
interactionTool
->
useTool
(
param
);
interactionTool
->
useTool
(
param
);
param
=
nullptr
;
param
=
nullptr
;
//setImage(*interactionTool->getPicture()->getCurrentLayerAsQ());
emit
updateLayer
();
emit
updateLayer
();
emit
updateVisible
();
emit
updateVisible
();
param
=
new
toolParameters_t
;
param
=
new
toolParameters_t
;
...
@@ -146,7 +129,6 @@ bool DrawDock::mouseEvent(QMouseEvent *event, eventType_e type, int w1, int w2,
...
@@ -146,7 +129,6 @@ bool DrawDock::mouseEvent(QMouseEvent *event, eventType_e type, int w1, int w2,
break
;
break
;
}
}
case
drawModus_e
::
lines
:{
case
drawModus_e
::
lines
:{
//setImage(*interactionTool->getPicture()->getCurrentLayerAsQ());
emit
updateLayer
();
emit
updateLayer
();
emit
updateVisible
();
emit
updateVisible
();
para1
p
;
para1
p
;
...
@@ -174,10 +156,8 @@ bool DrawDock::mouseEvent(QMouseEvent *event, eventType_e type, int w1, int w2,
...
@@ -174,10 +156,8 @@ bool DrawDock::mouseEvent(QMouseEvent *event, eventType_e type, int w1, int w2,
param
->
endPoint
=
event
->
pos
()
-
QPoint
(
w1
-
w2
,
h1
-
h2
);
param
->
endPoint
=
event
->
pos
()
-
QPoint
(
w1
-
w2
,
h1
-
h2
);
interactionTool
->
useTool
(
param
);
interactionTool
->
useTool
(
param
);
param
=
nullptr
;
param
=
nullptr
;
//setImage(*interactionTool->getPicture()->getCurrentLayerAsQ());
emit
updateLayer
();
emit
updateLayer
();
emit
updateVisible
();
emit
updateVisible
();
break
;
break
;
}
}
case
drawModus_e
::
lines
:{
case
drawModus_e
::
lines
:{
...
@@ -185,18 +165,14 @@ bool DrawDock::mouseEvent(QMouseEvent *event, eventType_e type, int w1, int w2,
...
@@ -185,18 +165,14 @@ bool DrawDock::mouseEvent(QMouseEvent *event, eventType_e type, int w1, int w2,
param
->
endPoint
=
event
->
pos
()
-
QPoint
(
w1
-
w2
,
h1
-
h2
);
param
->
endPoint
=
event
->
pos
()
-
QPoint
(
w1
-
w2
,
h1
-
h2
);
interactionTool
->
useTool
(
param
);
interactionTool
->
useTool
(
param
);
param
=
nullptr
;
param
=
nullptr
;
//setImage(*interactionTool->getPicture()->getCurrentLayerAsQ());
emit
updateLayer
();
emit
updateLayer
();
emit
updateVisible
();
emit
updateVisible
();
break
;
break
;
}
}
case
drawModus_e
::
filledRect
:{
case
drawModus_e
::
filledRect
:{
//if () TODO: Start & Endpkt vergleichen
//if () TODO: Start & Endpkt vergleichen
param
->
poly
.
push_back
(
event
->
pos
()
-
QPoint
(
w1
-
w2
+
interactionTool
->
getPicture
()
->
currentXOffset
(),
h1
-
h2
+
interactionTool
->
getPicture
()
->
currentYOffset
()));
param
->
poly
.
push_back
(
event
->
pos
()
-
QPoint
(
w1
-
w2
+
interactionTool
->
getPicture
()
->
currentXOffset
(),
h1
-
h2
+
interactionTool
->
getPicture
()
->
currentYOffset
()));
polyVis
.
push_back
(
event
->
pos
()
-
QPoint
(
w1
-
w2
,
h1
-
h2
));
polyVis
.
push_back
(
event
->
pos
()
-
QPoint
(
w1
-
w2
,
h1
-
h2
));
//param->poly.setPoint();
//setImage(*interactionTool->getPicture()->getCurrentLayerAsQ());
emit
updateLayer
();
emit
updateLayer
();
emit
updateVisible
();
emit
updateVisible
();
para2
p
;
para2
p
;
...
@@ -210,8 +186,6 @@ bool DrawDock::mouseEvent(QMouseEvent *event, eventType_e type, int w1, int w2,
...
@@ -210,8 +186,6 @@ bool DrawDock::mouseEvent(QMouseEvent *event, eventType_e type, int w1, int w2,
//if () TODO: Start & Endpkt vergleichen
//if () TODO: Start & Endpkt vergleichen
param
->
poly
.
push_back
(
event
->
pos
()
-
QPoint
(
w1
-
w2
+
interactionTool
->
getPicture
()
->
currentXOffset
(),
h1
-
h2
+
interactionTool
->
getPicture
()
->
currentYOffset
()));
param
->
poly
.
push_back
(
event
->
pos
()
-
QPoint
(
w1
-
w2
+
interactionTool
->
getPicture
()
->
currentXOffset
(),
h1
-
h2
+
interactionTool
->
getPicture
()
->
currentYOffset
()));
polyVis
.
push_back
(
event
->
pos
()
-
QPoint
(
w1
-
w2
,
h1
-
h2
));
polyVis
.
push_back
(
event
->
pos
()
-
QPoint
(
w1
-
w2
,
h1
-
h2
));
//param->poly.setPoint();
//setImage(*interactionTool->getPicture()->getCurrentLayerAsQ());
emit
updateLayer
();
emit
updateLayer
();
emit
updateVisible
();
emit
updateVisible
();
para2
p
;
para2
p
;
...
@@ -232,11 +206,8 @@ bool DrawDock::mouseEvent(QMouseEvent *event, eventType_e type, int w1, int w2,
...
@@ -232,11 +206,8 @@ bool DrawDock::mouseEvent(QMouseEvent *event, eventType_e type, int w1, int w2,
param
->
colorIndex
=
drawColorIndex
;
param
->
colorIndex
=
drawColorIndex
;
interactionTool
->
useTool
(
param
);
interactionTool
->
useTool
(
param
);
param
=
nullptr
;
param
=
nullptr
;
//setImage(*interactionTool->getPicture()->getCurrentLayerAsQ());
emit
updateLayer
();
emit
updateLayer
();
emit
updateVisible
();
emit
updateVisible
();
//statusBar()->showMessage("message");
break
;
break
;
}
}
case
drawModus_e
::
notFilledRect
:{
case
drawModus_e
::
notFilledRect
:{
...
@@ -244,11 +215,8 @@ bool DrawDock::mouseEvent(QMouseEvent *event, eventType_e type, int w1, int w2,
...
@@ -244,11 +215,8 @@ bool DrawDock::mouseEvent(QMouseEvent *event, eventType_e type, int w1, int w2,
param
->
colorIndex
=
drawColorIndex
;
param
->
colorIndex
=
drawColorIndex
;
interactionTool
->
useTool
(
param
);
interactionTool
->
useTool
(
param
);
param
=
nullptr
;
param
=
nullptr
;
//setImage(*interactionTool->getPicture()->getCurrentLayerAsQ());
emit
updateLayer
();
emit
updateLayer
();
emit
updateVisible
();
emit
updateVisible
();
//statusBar()->showMessage("message");
break
;
break
;
}
}
default
:
{
default
:
{
...
@@ -261,9 +229,6 @@ bool DrawDock::mouseEvent(QMouseEvent *event, eventType_e type, int w1, int w2,
...
@@ -261,9 +229,6 @@ bool DrawDock::mouseEvent(QMouseEvent *event, eventType_e type, int w1, int w2,
}
}
}
}
}
}
//QDockWidget *DrawDock::getDockWidget(){
// return drawDock;
//}
void
DrawDock
::
pencil
(){
void
DrawDock
::
pencil
(){
actDrawModus
=
drawModus_e
::
pencil
;
actDrawModus
=
drawModus_e
::
pencil
;
}
}
...
@@ -271,14 +236,12 @@ void DrawDock::startDraw(){
...
@@ -271,14 +236,12 @@ void DrawDock::startDraw(){
if
(
isDraw
){
if
(
isDraw
){
isDraw
=
false
;
isDraw
=
false
;
drawStartButton
->
setText
(
"Start"
);
drawStartButton
->
setText
(
"Start"
);
//drawSlider->setEnabled(true)
;
param
=
nullptr
;
//drawSpinbox->setEnabled(true
);
emit
updateLayer
(
);
emit
updateVisible
();
}
else
{
}
else
{
isDraw
=
true
;
isDraw
=
true
;
drawStartButton
->
setText
(
"Stop"
);
drawStartButton
->
setText
(
"Stop"
);
//drawSlider->setEnabled(false);
//drawSpinbox->setEnabled(false);
}
}
}
}
void
DrawDock
::
lines
(){
void
DrawDock
::
lines
(){
...
@@ -295,12 +258,8 @@ void DrawDock::setDrawColor(){
...
@@ -295,12 +258,8 @@ void DrawDock::setDrawColor(){
if
(
colorAct
[
i
]
->
isChecked
()){
if
(
colorAct
[
i
]
->
isChecked
()){
colorAct
[
i
]
->
setChecked
(
false
);
colorAct
[
i
]
->
setChecked
(
false
);
drawColorIndex
=
i
;
drawColorIndex
=
i
;
//newLayerDock->setDrawColorIndex(drawColorIndex);
QString
str
;
QString
str
;
//str.append(qRed(colorVect[i]));
//str.append(";");
str
.
sprintf
(
"padding:0px;background-color: qlineargradient(stop:0 #%02x%02x%02x);"
,
qRed
(
colorVect
[
i
]),
qGreen
(
colorVect
[
i
]),
qBlue
(
colorVect
[
i
]));
str
.
sprintf
(
"padding:0px;background-color: qlineargradient(stop:0 #%02x%02x%02x);"
,
qRed
(
colorVect
[
i
]),
qGreen
(
colorVect
[
i
]),
qBlue
(
colorVect
[
i
]));
//printf("background-color: #%02x%02x%02x;\n",qRed(colorVect[i]),qGreen(colorVect[i]),qBlue(colorVect[i]));
colorButton
->
setStyleSheet
(
str
);
colorButton
->
setStyleSheet
(
str
);
QPixmap
px
(
40
,
20
);
QPixmap
px
(
40
,
20
);
px
.
fill
(
QColor
(
0
,
0
,
0
,
0
));
px
.
fill
(
QColor
(
0
,
0
,
0
,
0
));
...
@@ -318,10 +277,6 @@ void DrawDock::setDrawColor(){
...
@@ -318,10 +277,6 @@ void DrawDock::setDrawColor(){
p
.
fillRect
(
20
,
10
,
10
,
10
,
*
br2
);
p
.
fillRect
(
20
,
10
,
10
,
10
,
*
br2
);
p
.
fillRect
(
30
,
0
,
10
,
10
,
*
br2
);
p
.
fillRect
(
30
,
0
,
10
,
10
,
*
br2
);
p
.
end
();
p
.
end
();
//colorButton->setIcon(px);
//QString str;
//str.sprintf("%d",i);
//statusBar()->showMessage(str);
}
}
}
}
}
}
...
@@ -351,36 +306,24 @@ QDockWidget *DrawDock::createDrawDock(){
...
@@ -351,36 +306,24 @@ QDockWidget *DrawDock::createDrawDock(){
color
->
setText
(
"Color:"
);
color
->
setText
(
"Color:"
);
drawLayout
->
addWidget
(
color
,
4
,
0
);
drawLayout
->
addWidget
(
color
,
4
,
0
);
drawLayout
->
addWidget
(
colorButton
,
4
,
1
);
drawLayout
->
addWidget
(
colorButton
,
4
,
1
);
drawLayout
->
addWidget
(
ignoreShaped
,
5
,
0
,
1
,
2
);
drawLayout
->
addWidget
(
ignoreShaped
,
5
,
0
,
1
,
2
);
QLabel
*
width
=
new
QLabel
();
QLabel
*
width
=
new
QLabel
();
width
->
setText
(
"Width:"
);
width
->
setText
(
"Width:"
);
drawLayout
->
addWidget
(
width
,
6
,
0
);
drawLayout
->
addWidget
(
width
,
6
,
0
);
drawLayout
->
addWidget
(
drawSpinbox
,
6
,
1
);
drawLayout
->
addWidget
(
drawSpinbox
,
6
,
1
);
QDialog
*
text
=
new
QDialog
();
QDialog
*
text
=
new
QDialog
();
drawLayout
->
addWidget
(
text
,
8
,
1
,
1
,
2
);
drawLayout
->
addWidget
(
text
,
8
,
1
,
1
,
2
);
drawLayout
->
addWidget
(
drawSlider
,
7
,
0
,
1
,
2
);
drawLayout
->
addWidget
(
drawSlider
,
7
,
0
,
1
,
2
);
drawLayout
->
addWidget
(
drawStartButton
,
8
,
0
,
1
,
2
);
drawLayout
->
addWidget
(
drawStartButton
,
8
,
0
,
1
,
2
);
//QSpacerItem *spacer = new QSpacerItem(1,300,QSizePolicy::Maximum,QSizePolicy::Maximum);
//newLayerLayout->addItem(spacer,9,0,1,2);
QWidget
*
drawControl
=
new
QWidget
(
drawDock
);
QWidget
*
drawControl
=
new
QWidget
(
drawDock
);
drawControl
->
setLayout
(
drawLayout
);
drawControl
->
setLayout
(
drawLayout
);
//layerScrollArea = new QScrollArea();
//layerScrollArea->setWidget(layers);
drawDock
->
setWidget
(
drawControl
);
drawDock
->
setWidget
(
drawControl
);
//addDockWidget(Qt::LeftDockWidgetArea, drawDock);
return
drawDock
;
return
drawDock
;
}
}
void
DrawDock
::
setColorVect
(
QVector
<
QRgb
>
colorVect
){
void
DrawDock
::
setColorVect
(
QVector
<
QRgb
>
colorVect
){
this
->
colorVect
=
colorVect
;
this
->
colorVect
=
colorVect
;
QPixmap
px
(
20
,
20
);
QPixmap
px
(
20
,
20
);
//colorVect = interactionTool->getPicture()->getCurrentLayerAsQ()->colorTable();
for
(
int
i
=
0
;
i
<
256
;
i
++
){
for
(
int
i
=
0
;
i
<
256
;
i
++
){
QPainter
p
(
&
px
);
QPainter
p
(
&
px
);
QBrush
br1
(
QColor
(
100
,
100
,
100
));
QBrush
br1
(
QColor
(
100
,
100
,
100
));
QBrush
br2
(
QColor
(
200
,
200
,
200
));
QBrush
br2
(
QColor
(
200
,
200
,
200
));
...
@@ -391,13 +334,8 @@ void DrawDock::setColorVect(QVector<QRgb> colorVect){
...
@@ -391,13 +334,8 @@ void DrawDock::setColorVect(QVector<QRgb> colorVect){
p
.
fillRect
(
10
,
0
,
10
,
10
,
br2
);
p
.
fillRect
(
10
,
0
,
10
,
10
,
br2
);
p
.
fillRect
(
0
,
0
,
20
,
20
,
br3
);
p
.
fillRect
(
0
,
0
,
20
,
20
,
br3
);
p
.
end
();
p
.
end
();
//colorButtons[i]->setIcon(px);
QString
str
;
QString
str
;
//str.append(qRed(colorVect[i]));
//str.append(";");
str
.
sprintf
(
"padding:0px;background-color: qlineargradient(stop:0 #%02x%02x%02x);"
,
qRed
(
colorVect
[
i
]),
qGreen
(
colorVect
[
i
]),
qBlue
(
colorVect
[
i
]));
str
.
sprintf
(
"padding:0px;background-color: qlineargradient(stop:0 #%02x%02x%02x);"
,
qRed
(
colorVect
[
i
]),
qGreen
(
colorVect
[
i
]),
qBlue
(
colorVect
[
i
]));
//printf("background-color: #%02x%02x%02x;\n",qRed(colorVect[i]),qGreen(colorVect[i]),qBlue(colorVect[i]));
if
(
i
==
drawColorIndex
){
if
(
i
==
drawColorIndex
){
QString
str
;
QString
str
;
str
.
sprintf
(
"padding:0px;background-color: qlineargradient(stop:0 #%02x%02x%02x);"
,
qRed
(
colorVect
[
i
]),
qGreen
(
colorVect
[
i
]),
qBlue
(
colorVect
[
i
]));
str
.
sprintf
(
"padding:0px;background-color: qlineargradient(stop:0 #%02x%02x%02x);"
,
qRed
(
colorVect
[
i
]),
qGreen
(
colorVect
[
i
]),
qBlue
(
colorVect
[
i
]));
...
@@ -418,7 +356,6 @@ void DrawDock::setColorVect(QVector<QRgb> colorVect){
...
@@ -418,7 +356,6 @@ void DrawDock::setColorVect(QVector<QRgb> colorVect){
p
.
fillRect
(
30
,
0
,
10
,
10
,
*
br2
);
p
.
fillRect
(
30
,
0
,
10
,
10
,
*
br2
);
p
.
end
();
p
.
end
();
colorButton
->
setStyleSheet
(
str
);
colorButton
->
setStyleSheet
(
str
);
//colorButton->setIcon(px);
}
}
colorAct
[
i
]
->
setIcon
(
px
);
colorAct
[
i
]
->
setIcon
(
px
);
}
}
...
@@ -435,12 +372,10 @@ void DrawDock::setColorVect(QVector<QRgb> colorVect){
...
@@ -435,12 +372,10 @@ void DrawDock::setColorVect(QVector<QRgb> colorVect){
p
.
drawLine
(
1
,
19
,
19
,
1
);
p
.
drawLine
(
1
,
19
,
19
,
1
);
p
.
drawLine
(
19
,
19
,
1
,
1
);
p
.
drawLine
(
19
,
19
,
1
,
1
);
colorAct
[
255
]
->
setIcon
(
px
);
colorAct
[
255
]
->
setIcon
(
px
);
//colorAct[255]->setEnabled(false);
}
else
{
}
else
{
colorAct
[
255
]
->
setEnabled
(
true
);
colorAct
[
255
]
->
setEnabled
(
true
);
px
.
fill
(
QColor
(
255
,
255
,
255
,
0
));
px
.
fill
(
QColor
(
255
,
255
,
255
,
0
));
colorAct
[
255
]
->
setIcon
(
px
);
colorAct
[
255
]
->
setIcon
(
px
);
}
}
colorButton
->
setMenu
(
colorMenu
);
colorButton
->
setMenu
(
colorMenu
);
//}
}
}
This diff is collapsed.
Click to expand it.
Implementation/GUI/imageviewer.cpp
+
1
−
4
View file @
16fbaccc
...
@@ -2,10 +2,7 @@
...
@@ -2,10 +2,7 @@
#include
<QtWidgets>
#include
<QtWidgets>
#include
<cstdlib>
#include
<cstdlib>
ImageViewer
::
ImageViewer
(
QWidget
*
parent
)
ImageViewer
::
ImageViewer
(
QWidget
*
parent
)
:
QMainWindow
(
parent
),
imageLabel
(
new
QLabel
)
,
scrollArea
(
new
QScrollArea
),
scaleFactor
(
1
){
:
QMainWindow
(
parent
),
imageLabel
(
new
QLabel
),
scrollArea
(
new
QScrollArea
),
scaleFactor
(
1
)
{
interactionTool
=
new
InteractionTool
();
interactionTool
=
new
InteractionTool
();
imageLabel
->
setBackgroundRole
(
QPalette
::
Dark
);
imageLabel
->
setBackgroundRole
(
QPalette
::
Dark
);
imageLabel
->
setSizePolicy
(
QSizePolicy
::
Ignored
,
QSizePolicy
::
Ignored
);
imageLabel
->
setSizePolicy
(
QSizePolicy
::
Ignored
,
QSizePolicy
::
Ignored
);
...
...
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