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
257e03c8
Commit
257e03c8
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
AxesPanel::updatePanel complete
parent
598717f7
No related branches found
Branches containing commit
No related tags found
1 merge request
!2449
restore axes panel
Pipeline
#134175
passed
1 year ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/View/Setup/AxesPanel.cpp
+17
-17
17 additions, 17 deletions
GUI/View/Setup/AxesPanel.cpp
GUI/View/Setup/AxisPanel.cpp
+4
-3
4 additions, 3 deletions
GUI/View/Setup/AxisPanel.cpp
with
21 additions
and
20 deletions
GUI/View/Setup/AxesPanel.cpp
+
17
−
17
View file @
257e03c8
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
#include
"GUI/Model/Axis/AmplitudeAxisItem.h"
#include
"GUI/Model/Axis/AmplitudeAxisItem.h"
#include
"GUI/Model/Axis/BasicAxisItem.h"
#include
"GUI/Model/Axis/BasicAxisItem.h"
#include
"GUI/Model/Data/Data2DItem.h"
#include
"GUI/Model/Data/Data2DItem.h"
#include
"GUI/Model/Files/DatafilesSet.h"
#include
"GUI/Model/Job/DataSource.h"
#include
"GUI/Model/Job/DataSource.h"
#include
"GUI/Model/Project/ProjectDocument.h"
#include
"GUI/Model/Project/ProjectDocument.h"
#include
"GUI/Support/Data/ComboProperty.h"
#include
"GUI/Support/Data/ComboProperty.h"
...
@@ -39,14 +40,6 @@ AxesPanel::AxesPanel(DataSource* ds)
...
@@ -39,14 +40,6 @@ AxesPanel::AxesPanel(DataSource* ds)
layout
->
setContentsMargins
(
8
,
20
,
8
,
8
);
layout
->
setContentsMargins
(
8
,
20
,
8
,
8
);
layout
->
setSpacing
(
5
);
layout
->
setSpacing
(
5
);
if
(
m_data_source
->
allData2DItems
().
empty
())
return
;
for
(
auto
*
item
:
m_data_source
->
allData2DItems
())
disconnect
(
item
,
nullptr
,
this
,
nullptr
);
m_updaters
.
clear
();
layout
->
addRow
(
"Color scheme:"
,
layout
->
addRow
(
"Color scheme:"
,
GUI
::
Util
::
createComboBox
([
this
]
{
return
*
gApp
->
color_gradient_combo
;
},
GUI
::
Util
::
createComboBox
([
this
]
{
return
*
gApp
->
color_gradient_combo
;
},
[
this
](
const
QString
&
s
)
{
[
this
](
const
QString
&
s
)
{
...
@@ -186,11 +179,8 @@ AxesPanel::AxesPanel(DataSource* ds)
...
@@ -186,11 +179,8 @@ AxesPanel::AxesPanel(DataSource* ds)
layout
->
addRow
(
zGroup
);
layout
->
addRow
(
zGroup
);
updateUIValues
();
connect
(
gDoc
->
datafiles
(),
&
DatafilesSet
::
setChanged
,
this
,
&
AxesPanel
::
updatePanel
);
updatePanel
();
// react on external changes (e.g. zooming in customplot shall update the axis values)
connect
(
m_data_source
->
currentData2DItem
(),
&
DataItem
::
itemAxesRangeChanged
,
this
,
&
AxesPanel
::
updateUIValues
,
Qt
::
UniqueConnection
);
}
}
AxesPanel
::~
AxesPanel
()
=
default
;
AxesPanel
::~
AxesPanel
()
=
default
;
...
@@ -200,11 +190,21 @@ Data2DItem* AxesPanel::dataItem()
...
@@ -200,11 +190,21 @@ Data2DItem* AxesPanel::dataItem()
return
m_data_source
->
currentData2DItem
();
return
m_data_source
->
currentData2DItem
();
}
}
void
AxesPanel
::
updatePanel
()
{}
void
AxesPanel
::
updatePanel
()
{
if
(
dataItem
())
{
// react on external changes (e.g. zooming in customplot shall update the axis values)
connect
(
m_data_source
->
currentData2DItem
(),
&
DataItem
::
itemAxesRangeChanged
,
this
,
&
AxesPanel
::
updateUIValues
,
Qt
::
UniqueConnection
);
updateUIValues
();
show
();
}
else
hide
();
}
void
AxesPanel
::
updateUIValues
()
void
AxesPanel
::
updateUIValues
()
{
{
if
(
m_data_source
->
currentData2D
Item
())
ASSERT
(
data
Item
())
;
for
(
const
auto
&
updater
:
m_updaters
)
for
(
const
auto
&
updater
:
m_updaters
)
updater
();
updater
();
}
}
This diff is collapsed.
Click to expand it.
GUI/View/Setup/AxisPanel.cpp
+
4
−
3
View file @
257e03c8
...
@@ -145,6 +145,7 @@ void AxisPanel::updatePanel()
...
@@ -145,6 +145,7 @@ void AxisPanel::updatePanel()
for
(
auto
*
item
:
m_data_source
->
allData1DItems
())
for
(
auto
*
item
:
m_data_source
->
allData1DItems
())
connect
(
item
,
&
DataItem
::
axesUnitsChanged
,
this
,
&
AxisPanel
::
updateItemCoords
,
connect
(
item
,
&
DataItem
::
axesUnitsChanged
,
this
,
&
AxisPanel
::
updateItemCoords
,
Qt
::
UniqueConnection
);
Qt
::
UniqueConnection
);
updateUIValues
();
show
();
show
();
}
else
}
else
hide
();
hide
();
...
@@ -161,7 +162,7 @@ void AxisPanel::updateItemCoords(DataItem* item)
...
@@ -161,7 +162,7 @@ void AxisPanel::updateItemCoords(DataItem* item)
void
AxisPanel
::
updateUIValues
()
void
AxisPanel
::
updateUIValues
()
{
{
if
(
dataItem
())
ASSERT
(
dataItem
())
;
for
(
const
auto
&
updater
:
m_updaters
)
for
(
const
auto
&
updater
:
m_updaters
)
updater
();
updater
();
}
}
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