Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
f5c4acec
Commit
f5c4acec
authored
7 years ago
by
Pospelov, Gennady
Browse files
Options
Downloads
Patches
Plain Diff
Standard code beautification in ColorMapLabel.
parent
c48fc12b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/coregui/Views/IntensityDataWidgets/ColorMapLabel.cpp
+7
-11
7 additions, 11 deletions
GUI/coregui/Views/IntensityDataWidgets/ColorMapLabel.cpp
GUI/coregui/Views/IntensityDataWidgets/ColorMapLabel.h
+2
-2
2 additions, 2 deletions
GUI/coregui/Views/IntensityDataWidgets/ColorMapLabel.h
with
9 additions
and
13 deletions
GUI/coregui/Views/IntensityDataWidgets/ColorMapLabel.cpp
+
7
−
11
View file @
f5c4acec
...
...
@@ -40,7 +40,7 @@ void ColorMapLabel::addColorMap(ColorMapCanvas* colorMapCanvas)
void
ColorMapLabel
::
setLabelEnabled
(
bool
flag
)
{
for
each
(
ColorMap
*
colorMap
,
m_colorMaps
)
for
(
auto
colorMap
:
m_colorMaps
)
setColorMapLabelEnabled
(
colorMap
,
flag
);
setEnabled
(
flag
);
...
...
@@ -50,16 +50,13 @@ void ColorMapLabel::setLabelEnabled(bool flag)
void
ColorMapLabel
::
reset
()
{
for
each
(
ColorMap
*
colorMap
,
m_colorMaps
)
for
(
auto
colorMap
:
m_colorMaps
)
setColorMapLabelEnabled
(
colorMap
,
false
);
m_colorMaps
.
clear
();
}
void
ColorMapLabel
::
onColorMapStatusString
(
const
QString
&
text
)
{
setText
(
text
);
}
void
ColorMapLabel
::
onColorMapStatusString
(
const
QString
&
text
)
{
setText
(
text
);
}
//! Enables/disables showing of label for given color map.
...
...
@@ -74,18 +71,17 @@ void ColorMapLabel::setColorMapLabelEnabled(ColorMap* colorMap, bool flag)
void
ColorMapLabel
::
setConnected
(
ColorMap
*
colorMap
,
bool
flag
)
{
if
(
flag
)
{
connect
(
colorMap
,
SIGNAL
(
statusString
(
const
QString
&
))
,
this
,
SLOT
(
onColorMapStatusString
(
const
QString
&
))
,
Qt
::
UniqueConnection
);
connect
(
colorMap
,
&
ColorMap
::
statusString
,
this
,
&
ColorMapLabel
::
onColorMapStatusString
,
Qt
::
UniqueConnection
);
connect
(
colorMap
,
&
ColorMap
::
destroyed
,
this
,
&
ColorMapLabel
::
onColorMapDestroyed
);
}
else
{
disconnect
(
colorMap
,
SIGNAL
(
statusString
(
const
QString
&
)),
this
,
SLOT
(
onColorMapStatusString
(
const
QString
&
)));
disconnect
(
colorMap
,
&
ColorMap
::
statusString
,
this
,
&
ColorMapLabel
::
onColorMapStatusString
);
}
}
void
ColorMapLabel
::
onColorMapDestroyed
(
QObject
*
obj
)
{
auto
it
=
std
::
remove_if
(
m_colorMaps
.
begin
(),
m_colorMaps
.
end
(),
[
obj
](
ColorMap
*
cm
)
{
return
cm
==
obj
;});
[
obj
](
ColorMap
*
cm
)
{
return
cm
==
obj
;
});
m_colorMaps
.
erase
(
it
,
m_colorMaps
.
end
());
}
This diff is collapsed.
Click to expand it.
GUI/coregui/Views/IntensityDataWidgets/ColorMapLabel.h
+
2
−
2
View file @
f5c4acec
...
...
@@ -25,13 +25,13 @@ class QResizeEvent;
//! The ColorMapLabel class shows status string as reported by ColorMap in a frame.
//! Can work with more than one ColorMap. Provides automatic adjustment of font size,
//! depending on available space in parent layout. Also doesn't trigger layout resize,
//! be
e
ing happy with place it has.
//! being happy with place it has.
class
BA_CORE_API_
ColorMapLabel
:
public
StatusLabel
{
Q_OBJECT
public:
ColorMapLabel
(
ColorMap
*
colorMap
,
QWidget
*
parent
=
0
);
ColorMapLabel
(
ColorMap
*
colorMap
,
QWidget
*
parent
=
nullptr
);
void
addColorMap
(
ColorMap
*
colorMap
);
void
addColorMap
(
ColorMapCanvas
*
colorMapCanvas
);
...
...
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