Skip to content
Snippets Groups Projects
Commit 598717f7 authored by Wuttke, Joachim's avatar Wuttke, Joachim Committed by Wuttke, Joachim
Browse files

prepare AxesPanel for same update mechanism as in AxisPanel

parent 95efa119
No related branches found
No related tags found
1 merge request!2449restore axes panel
......@@ -195,8 +195,16 @@ AxesPanel::AxesPanel(DataSource* ds)
AxesPanel::~AxesPanel() = default;
Data2DItem* AxesPanel::dataItem()
{
return m_data_source->currentData2DItem();
}
void AxesPanel::updatePanel() {}
void AxesPanel::updateUIValues()
{
for (const auto& updater : m_updaters)
updater();
if (m_data_source->currentData2DItem())
for (const auto& updater : m_updaters)
updater();
}
......@@ -17,6 +17,7 @@
#include <QWidget>
class Data2DItem;
class DataSource;
//! Widget to edit properties of a Data2DItem.
......@@ -27,6 +28,8 @@ public:
~AxesPanel();
private:
Data2DItem* dataItem();
void updatePanel();
void updateUIValues();
QVector<std::function<void()>> m_updaters;
......
......@@ -161,7 +161,7 @@ void AxisPanel::updateItemCoords(DataItem* item)
void AxisPanel::updateUIValues()
{
if (m_data_source->currentData1DItem())
if (dataItem())
for (const auto& updater : m_updaters)
updater();
}
......@@ -28,10 +28,9 @@ public:
AxisPanel(DataSource*);
~AxisPanel();
private:
Data1DItem* dataItem();
void updatePanel();
private:
void updateItemCoords(DataItem* item);
void updateUIValues();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment