Commit e0b1a4db authored by Mikhail Svechnikov's avatar Mikhail Svechnikov Committed by Mikhail Svechnikov
Browse files

changing signaling in IntensityDataPropertyWidget almost done

parent e7afdc40
...@@ -203,19 +203,16 @@ bool IntensityDataItem::isZAxisLocked() const ...@@ -203,19 +203,16 @@ bool IntensityDataItem::isZAxisLocked() const
void IntensityDataItem::setZAxisLocked(bool state) void IntensityDataItem::setZAxisLocked(bool state)
{ {
item<AmplitudeAxisItem>(P_ZAXIS)->setLocked(state); item<AmplitudeAxisItem>(P_ZAXIS)->setLocked(state);
emit zAxisLockChanged(state);
} }
void IntensityDataItem::setXaxisTitle(const QString& title) void IntensityDataItem::setXaxisTitle(const QString& title)
{ {
xAxisItem()->setTitle(title); xAxisItem()->setTitle(title);
emit xAxisTitleChanged(title);
} }
void IntensityDataItem::setYaxisTitle(const QString& title) void IntensityDataItem::setYaxisTitle(const QString& title)
{ {
yAxisItem()->setTitle(title); yAxisItem()->setTitle(title);
emit yAxisTitleChanged(title);
} }
//! set zoom range of x,y axes to axes of input data //! set zoom range of x,y axes to axes of input data
...@@ -284,25 +281,21 @@ bool IntensityDataItem::isZaxisPropertyName(const QString& name) ...@@ -284,25 +281,21 @@ bool IntensityDataItem::isZaxisPropertyName(const QString& name)
void IntensityDataItem::setLowerX(double value) void IntensityDataItem::setLowerX(double value)
{ {
xAxisItem()->setLowerBound(value); xAxisItem()->setLowerBound(value);
emit xAxisLowerChanged(value);
} }
void IntensityDataItem::setUpperX(double value) void IntensityDataItem::setUpperX(double value)
{ {
xAxisItem()->setUpperBound(value); xAxisItem()->setUpperBound(value);
emit xAxisUpperChanged(value);
} }
void IntensityDataItem::setLowerY(double value) void IntensityDataItem::setLowerY(double value)
{ {
yAxisItem()->setLowerBound(value); yAxisItem()->setLowerBound(value);
emit yAxisLowerChanged(value);
} }
void IntensityDataItem::setUpperY(double value) void IntensityDataItem::setUpperY(double value)
{ {
yAxisItem()->setUpperBound(value); yAxisItem()->setUpperBound(value);
emit yAxisUpperChanged(value);
} }
void IntensityDataItem::setLowerAndUpperZ(double zmin, double zmax) void IntensityDataItem::setLowerAndUpperZ(double zmin, double zmax)
...@@ -317,19 +310,17 @@ void IntensityDataItem::setLowerAndUpperZ(double zmin, double zmax) ...@@ -317,19 +310,17 @@ void IntensityDataItem::setLowerAndUpperZ(double zmin, double zmax)
void IntensityDataItem::setLowerZ(double zmin) void IntensityDataItem::setLowerZ(double zmin)
{ {
zAxisItem()->setLowerBound(zmin); zAxisItem()->setLowerBound(zmin);
emit zAxisLowerChanged(zmin);
} }
void IntensityDataItem::setUpperZ(double zmax) void IntensityDataItem::setUpperZ(double zmax)
{ {
zAxisItem()->setUpperBound(zmax); zAxisItem()->setUpperBound(zmax);
emit zAxisUpperChanged(zmax);
} }
void IntensityDataItem::setLogz(bool logz) void IntensityDataItem::setLogz(bool logz)
{ {
zAxisItem()->setLogScale(logz); zAxisItem()->setLogScale(logz);
emit zLogChanged(logz); emit zLogChanged();
} }
void IntensityDataItem::setInterpolated(bool interp) void IntensityDataItem::setInterpolated(bool interp)
......
...@@ -123,17 +123,8 @@ public: ...@@ -123,17 +123,8 @@ public:
signals: signals:
void gradientChanged(); void gradientChanged();
void zAxisLockChanged(bool isLocked); void zAxisLockChanged();
void xAxisTitleChanged(const QString& title); void zLogChanged();
void yAxisTitleChanged(const QString& title);
void xAxisLowerChanged(double value);
void xAxisUpperChanged(double value);
void yAxisLowerChanged(double value);
void yAxisUpperChanged(double value);
void zAxisLowerChanged(double value);
void zAxisUpperChanged(double value);
void zLogChanged(bool isLog);
void interpolationChanged(); void interpolationChanged();
public slots: public slots:
......
...@@ -64,6 +64,11 @@ DoubleDescriptor BasicAxisItem::max(const QString& unit) const ...@@ -64,6 +64,11 @@ DoubleDescriptor BasicAxisItem::max(const QString& unit) const
{ {
DoubleDescriptor d(getItem(P_MAX_DEG), unit); DoubleDescriptor d(getItem(P_MAX_DEG), unit);
d.label = "Max"; d.label = "Max";
// temp setter with signal
d.set = [=](double v) {
d.set(v);
emit const_cast<BasicAxisItem*>(this)->axisRangeChanged();
};
return d; return d;
} }
...@@ -90,6 +95,7 @@ QString BasicAxisItem::title() const ...@@ -90,6 +95,7 @@ QString BasicAxisItem::title() const
void BasicAxisItem::setTitle(const QString& title) void BasicAxisItem::setTitle(const QString& title)
{ {
setItemValue(P_TITLE, title); setItemValue(P_TITLE, title);
emit axisTitleChanged();
} }
SessionItem* BasicAxisItem::titleItem() const SessionItem* BasicAxisItem::titleItem() const
...@@ -123,7 +129,7 @@ SessionItem* BasicAxisItem::visibilityItem() const ...@@ -123,7 +129,7 @@ SessionItem* BasicAxisItem::visibilityItem() const
return getItem(P_IS_VISIBLE); return getItem(P_IS_VISIBLE);
} }
bool BasicAxisItem::visibilityValue() const bool BasicAxisItem::isVisible() const
{ {
return visibilityItem()->value().toBool(); return visibilityItem()->value().toBool();
} }
...@@ -131,6 +137,7 @@ bool BasicAxisItem::visibilityValue() const ...@@ -131,6 +137,7 @@ bool BasicAxisItem::visibilityValue() const
void BasicAxisItem::setVisibilityValue(bool b) void BasicAxisItem::setVisibilityValue(bool b)
{ {
setItemValue(P_IS_VISIBLE, b); setItemValue(P_IS_VISIBLE, b);
emit axisVisibilityChanged();
} }
bool BasicAxisItem::isVisibilityPropertyName(const QString& name) bool BasicAxisItem::isVisibilityPropertyName(const QString& name)
...@@ -188,6 +195,7 @@ bool AmplitudeAxisItem::isLogScale() const ...@@ -188,6 +195,7 @@ bool AmplitudeAxisItem::isLogScale() const
void AmplitudeAxisItem::setLogScale(bool value) void AmplitudeAxisItem::setLogScale(bool value)
{ {
setItemValue(P_IS_LOGSCALE, value); setItemValue(P_IS_LOGSCALE, value);
emit logScaleChanged();
} }
SessionItem* AmplitudeAxisItem::logScaleItem() const SessionItem* AmplitudeAxisItem::logScaleItem() const
......
...@@ -65,18 +65,21 @@ public: ...@@ -65,18 +65,21 @@ public:
virtual std::unique_ptr<IAxis> createAxis(double scale) const; virtual std::unique_ptr<IAxis> createAxis(double scale) const;
SessionItem* visibilityItem() const; SessionItem* visibilityItem() const;
bool visibilityValue() const; bool isVisible() const;
void setVisibilityValue(bool b); void setVisibilityValue(bool b);
static bool isVisibilityPropertyName(const QString& name); static bool isVisibilityPropertyName(const QString& name);
signals: signals:
void axisRangeChanged(); void axisRangeChanged();
void axisTitleChanged();
void axisVisibilityChanged();
protected: protected:
explicit BasicAxisItem(const QString& type); explicit BasicAxisItem(const QString& type);
}; };
class AmplitudeAxisItem : public BasicAxisItem { class AmplitudeAxisItem : public BasicAxisItem {
Q_OBJECT
private: private:
static constexpr auto P_IS_LOGSCALE{"log10"}; static constexpr auto P_IS_LOGSCALE{"log10"};
static constexpr auto P_LOCK_MIN_MAX{"Lock (min, max)"}; static constexpr auto P_LOCK_MIN_MAX{"Lock (min, max)"};
...@@ -94,6 +97,10 @@ public: ...@@ -94,6 +97,10 @@ public:
bool isLocked() const; bool isLocked() const;
void setLocked(bool locked); void setLocked(bool locked);
signals:
void logScaleChanged();
}; };
#endif // BORNAGAIN_GUI_MODEL_DEVICE_AXESITEMS_H #endif // BORNAGAIN_GUI_MODEL_DEVICE_AXESITEMS_H
...@@ -158,7 +158,7 @@ void ColorMap::onAxisPropertyChanged(const QString& axisName, const QString& pro ...@@ -158,7 +158,7 @@ void ColorMap::onAxisPropertyChanged(const QString& axisName, const QString& pro
setLogz(intensityItem()->isLogz()); setLogz(intensityItem()->isLogz());
replot(); replot();
} else if (BasicAxisItem::isVisibilityPropertyName(propertyName)) { } else if (BasicAxisItem::isVisibilityPropertyName(propertyName)) {
setColorScaleVisible(intensityItem()->zAxisItem()->visibilityValue()); setColorScaleVisible(intensityItem()->zAxisItem()->isVisible());
replot(); replot();
} }
} }
...@@ -221,7 +221,7 @@ void ColorMap::subscribeToItem() ...@@ -221,7 +221,7 @@ void ColorMap::subscribeToItem()
intensityItem()->mapper()->setOnValueChange([this]() { onIntensityModified(); }, this); intensityItem()->mapper()->setOnValueChange([this]() { onIntensityModified(); }, this);
#else #else
// axes units // units
connect(intensityItem(), &IntensityDataItem::axesUnitsReplotRequested, this, [=]() { connect(intensityItem(), &IntensityDataItem::axesUnitsReplotRequested, this, [=]() {
setAxesRangeFromItem(intensityItem()); setAxesRangeFromItem(intensityItem());
setAxesZoomFromItem(intensityItem()); setAxesZoomFromItem(intensityItem());
...@@ -239,13 +239,44 @@ void ColorMap::subscribeToItem() ...@@ -239,13 +239,44 @@ void ColorMap::subscribeToItem()
replot(); replot();
}); });
// axes // x axis
connect(intensityItem()->xAxisItem(), &BasicAxisItem::axisRangeChanged, this, [=]() { connect(intensityItem()->xAxisItem(), &BasicAxisItem::axisRangeChanged, this, [=]() {
setAxesRangeConnected(false); setAxesRangeConnected(false);
m_customPlot->xAxis->setRange(GUI::View::RangeUtils::itemZoomX(intensityItem())); m_customPlot->xAxis->setRange(GUI::View::RangeUtils::itemZoomX(intensityItem()));
setAxesRangeConnected(true); setAxesRangeConnected(true);
replot(); replot();
}); });
connect(intensityItem()->xAxisItem(), &BasicAxisItem::axisTitleChanged, this, [=]() {
setAxesLabelsFromItem(intensityItem());
replot();
});
// y axis
connect(intensityItem()->yAxisItem(), &BasicAxisItem::axisRangeChanged, this, [=]() {
setAxesRangeConnected(false);
m_customPlot->yAxis->setRange(GUI::View::RangeUtils::itemZoomY(intensityItem()));
setAxesRangeConnected(true);
replot();
});
connect(intensityItem()->yAxisItem(), &BasicAxisItem::axisTitleChanged, this, [=]() {
setAxesLabelsFromItem(intensityItem());
replot();
});
// z axis
connect(intensityItem()->zAxisItem(), &BasicAxisItem::axisRangeChanged, this, [=]() {
setDataRangeFromItem(intensityItem());
replot();
});
connect(intensityItem()->zAxisItem(), &AmplitudeAxisItem::logScaleChanged, this, [=]() {
setLogz(intensityItem()->isLogz());
replot();
});
connect(intensityItem()->zAxisItem(), &BasicAxisItem::axisVisibilityChanged, this, [=]() {
setColorScaleVisible(intensityItem()->zAxisItem()->isVisible());
replot();
});
#endif #endif
setConnected(true); setConnected(true);
} }
...@@ -418,7 +449,7 @@ void ColorMap::setDataFromItem(IntensityDataItem* item) ...@@ -418,7 +449,7 @@ void ColorMap::setDataFromItem(IntensityDataItem* item)
void ColorMap::setColorScaleAppearanceFromItem(IntensityDataItem* item) void ColorMap::setColorScaleAppearanceFromItem(IntensityDataItem* item)
{ {
setColorScaleVisible(item->zAxisItem()->visibilityValue()); setColorScaleVisible(item->zAxisItem()->isVisible());
m_colorMap->setGradient(GUI::View::RangeUtils::itemGradient(intensityItem())); m_colorMap->setGradient(GUI::View::RangeUtils::itemGradient(intensityItem()));
m_colorMap->setInterpolate(intensityItem()->isInterpolated()); m_colorMap->setInterpolate(intensityItem()->isInterpolated());
// make sure the axis rect and color scale synchronize their bottom and top margins (so they // make sure the axis rect and color scale synchronize their bottom and top margins (so they
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
#include <QGroupBox> #include <QGroupBox>
#include <QLineEdit> #include <QLineEdit>
#define FOR_EACH_ITEM \ #define FOR_EACH_ITEM \
for(IntensityDataItem* item : m_items_vec) \ for(IntensityDataItem* item : m_items_vec) \
if(item) if(item)
IntensityDataPropertyWidget::IntensityDataPropertyWidget(QWidget* parent) IntensityDataPropertyWidget::IntensityDataPropertyWidget(QWidget* parent)
...@@ -51,12 +51,10 @@ IntensityDataPropertyWidget::~IntensityDataPropertyWidget() ...@@ -51,12 +51,10 @@ IntensityDataPropertyWidget::~IntensityDataPropertyWidget()
void IntensityDataPropertyWidget::unsubscribe() void IntensityDataPropertyWidget::unsubscribe()
{ {
for(IntensityDataItem* item : m_items_vec)
if (item)
#ifdef USE_MAPPERS #ifdef USE_MAPPERS
item->mapper()->unsubscribe(this); FOR_EACH_ITEM item->mapper()->unsubscribe(this);
#else #else
disconnect(item, nullptr, this, nullptr); FOR_EACH_ITEM disconnect(item, nullptr, this, nullptr);
#endif #endif
} }
...@@ -75,25 +73,14 @@ void IntensityDataPropertyWidget::setItem(QVector<IntensityDataItem*> itemsVec) ...@@ -75,25 +73,14 @@ void IntensityDataPropertyWidget::setItem(QVector<IntensityDataItem*> itemsVec)
return; return;
m_mainLayout->addRow("Axes units:", createComboBox(first_item->axesUnits(), m_mainLayout->addRow("Axes units:", createComboBox(first_item->axesUnits(),
[=](int newIndex){ [=](int newIndex) { FOR_EACH_ITEM item->axesUnits().setCurrentIndex(newIndex); }));
for(IntensityDataItem* item : m_items_vec)
if(item)
item->axesUnits().setCurrentIndex(newIndex);
}));
m_mainLayout->addRow("Color scheme:", createComboBox(first_item->gradient(), m_mainLayout->addRow("Color scheme:", createComboBox(first_item->gradient(),
[=](int newIndex){ [=](int newIndex) { FOR_EACH_ITEM item->gradient().setCurrentIndex(newIndex); }));
for(IntensityDataItem* item : m_items_vec)
if(item)
item->gradient().setCurrentIndex(newIndex);
}));
m_mainLayout->addRow(createCheckBox("Interpolate", m_mainLayout->addRow(createCheckBox("Interpolate",
[=]() { return first_item->isInterpolated(); }, [=]() { return first_item->isInterpolated(); },
[=](bool b) { [=](bool b) { FOR_EACH_ITEM item->setInterpolated(b); }));
for(IntensityDataItem* item : m_items_vec)
if(item)
item->setInterpolated(b);
}));
// -- x-axis // -- x-axis
auto* xGroup = new QGroupBox("X axis", this); auto* xGroup = new QGroupBox("X axis", this);
...@@ -102,13 +89,13 @@ void IntensityDataPropertyWidget::setItem(QVector<IntensityDataItem*> itemsVec) ...@@ -102,13 +89,13 @@ void IntensityDataPropertyWidget::setItem(QVector<IntensityDataItem*> itemsVec)
xFormLayout->setSpacing(5); xFormLayout->setSpacing(5);
xFormLayout->addRow("Min:", createDoubleSpinbox(first_item->xAxisItem()->min(), xFormLayout->addRow("Min:", createDoubleSpinbox(first_item->xAxisItem()->min(),
[=](double newValue){ [=](double newValue) { FOR_EACH_ITEM item->xAxisItem()->min().set(newValue); }));
for(IntensityDataItem* item : m_items_vec)
if(item) xFormLayout->addRow("Max:", createDoubleSpinbox(first_item->xAxisItem()->max(),
item->xAxisItem()->min().set(newValue); [=](double newValue) { FOR_EACH_ITEM item->xAxisItem()->max().set(newValue); }));
}));
// xFormLayout->addRow("Max:", createDoubleSpinbox(first_item->xAxisItem()->max())); xFormLayout->addRow("Title:", createTextEdit(first_item->xAxisItem()->titleItem(),
// xFormLayout->addRow("Title:", createTextEdit(first_item->xAxisItem()->titleItem())); [=](QString newText) { FOR_EACH_ITEM item->xAxisItem()->setTitle(newText); }));
m_mainLayout->addRow(xGroup); m_mainLayout->addRow(xGroup);
...@@ -118,9 +105,14 @@ void IntensityDataPropertyWidget::setItem(QVector<IntensityDataItem*> itemsVec) ...@@ -118,9 +105,14 @@ void IntensityDataPropertyWidget::setItem(QVector<IntensityDataItem*> itemsVec)
yFormLayout->setContentsMargins(0, 0, 0, 0); yFormLayout->setContentsMargins(0, 0, 0, 0);
yFormLayout->setSpacing(5); yFormLayout->setSpacing(5);
// yFormLayout->addRow("Min:", createDoubleSpinbox(first_item->yAxisItem()->min())); yFormLayout->addRow("Min:", createDoubleSpinbox(first_item->yAxisItem()->min(),
// yFormLayout->addRow("Max:", createDoubleSpinbox(first_item->yAxisItem()->max())); [=](double newValue) { FOR_EACH_ITEM item->yAxisItem()->min().set(newValue); }));
yFormLayout->addRow("Title:", createTextEdit(first_item->yAxisItem()->titleItem()));
yFormLayout->addRow("Max:", createDoubleSpinbox(first_item->yAxisItem()->max(),
[=](double newValue) { FOR_EACH_ITEM item->yAxisItem()->max().set(newValue); }));
yFormLayout->addRow("Title:", createTextEdit(first_item->yAxisItem()->titleItem(),
[=](QString newText) { FOR_EACH_ITEM item->yAxisItem()->setTitle(newText); }));
m_mainLayout->addRow(yGroup); m_mainLayout->addRow(yGroup);
...@@ -130,10 +122,19 @@ void IntensityDataPropertyWidget::setItem(QVector<IntensityDataItem*> itemsVec) ...@@ -130,10 +122,19 @@ void IntensityDataPropertyWidget::setItem(QVector<IntensityDataItem*> itemsVec)
zFormLayout->setContentsMargins(0, 0, 0, 0); zFormLayout->setContentsMargins(0, 0, 0, 0);
zFormLayout->setSpacing(5); zFormLayout->setSpacing(5);
// zFormLayout->addRow("Min:", createDoubleSpinbox(first_item->zAxisItem()->min())); zFormLayout->addRow("Min:", createDoubleSpinbox(first_item->zAxisItem()->min(),
// zFormLayout->addRow("Max:", createDoubleSpinbox(first_item->zAxisItem()->max())); [=](double newValue) { FOR_EACH_ITEM item->zAxisItem()->min().set(newValue); }));
zFormLayout->addRow(createCheckBox("log10", first_item->zAxisItem()->logScaleItem()));
zFormLayout->addRow(createCheckBox("Visible", first_item->zAxisItem()->visibilityItem())); zFormLayout->addRow("Max:", createDoubleSpinbox(first_item->zAxisItem()->max(),
[=](double newValue) { FOR_EACH_ITEM item->zAxisItem()->max().set(newValue); }));
zFormLayout->addRow(createCheckBox("log10",
[=]() { return first_item->zAxisItem()->isLogScale(); },
[=](bool b) { FOR_EACH_ITEM item->zAxisItem()->setLogScale(b); }));
zFormLayout->addRow(createCheckBox("Visible",
[=]() { return first_item->zAxisItem()->isVisible(); },
[=](bool b) { FOR_EACH_ITEM item->zAxisItem()->setVisibilityValue(b); }));
m_mainLayout->addRow(zGroup); m_mainLayout->addRow(zGroup);
...@@ -151,9 +152,13 @@ void IntensityDataPropertyWidget::setItem(QVector<IntensityDataItem*> itemsVec) ...@@ -151,9 +152,13 @@ void IntensityDataPropertyWidget::setItem(QVector<IntensityDataItem*> itemsVec)
DataItem::updateAxesUnits(item, name, jobItem()->instrumentItem()); DataItem::updateAxesUnits(item, name, jobItem()->instrumentItem());
}, },
this); this);
FOR_EACH_ITEM
itemsVec[i]->mapper()->setOnItemDestroy(
[this, i](SessionItem*) { m_items_vec[i] = nullptr; }, this);
#else #else
for(IntensityDataItem* item : m_items_vec) FOR_EACH_ITEM
if(item)
connect(item, &IntensityDataItem::axesUnitsChanged, this, [=](){ connect(item, &IntensityDataItem::axesUnitsChanged, this, [=](){
if(jobItem()) { if(jobItem()) {
item->blockSignals(true); item->blockSignals(true);
...@@ -163,14 +168,6 @@ void IntensityDataPropertyWidget::setItem(QVector<IntensityDataItem*> itemsVec) ...@@ -163,14 +168,6 @@ void IntensityDataPropertyWidget::setItem(QVector<IntensityDataItem*> itemsVec)
} }
}); });
#endif #endif
for(int i=0; i<itemsVec.size(); i++)
if(itemsVec[i])
#ifdef USE_MAPPERS
itemsVec[i]->mapper()->setOnItemDestroy([this, i](SessionItem*) { m_items_vec[i] = nullptr; }, this);
#else
connect(itemsVec[i], &IntensityDataItem::destroyed, this, [=](){ m_items_vec[i] = nullptr; });
#endif
} }
const JobItem* IntensityDataPropertyWidget::jobItem() const const JobItem* IntensityDataPropertyWidget::jobItem() const
...@@ -182,7 +179,8 @@ const JobItem* IntensityDataPropertyWidget::jobItem() const ...@@ -182,7 +179,8 @@ const JobItem* IntensityDataPropertyWidget::jobItem() const
return dynamic_cast<JobItem*>(sessionItemWidget->currentItem()); return dynamic_cast<JobItem*>(sessionItemWidget->currentItem());
} }
QWidget* IntensityDataPropertyWidget::createDoubleSpinbox(DoubleDescriptor d, function<void(double)> slot) QWidget* IntensityDataPropertyWidget::createDoubleSpinbox(DoubleDescriptor d,
function<void(double)> slot)
{ {
auto* spinBox = new DoubleSpinBox(this, d); auto* spinBox = new DoubleSpinBox(this, d);
spinBox->setToolTip(d.tooltip); spinBox->setToolTip(d.tooltip);
...@@ -196,22 +194,20 @@ QWidget* IntensityDataPropertyWidget::createDoubleSpinbox(DoubleDescriptor d, fu ...@@ -196,22 +194,20 @@ QWidget* IntensityDataPropertyWidget::createDoubleSpinbox(DoubleDescriptor d, fu
return spinBox; return spinBox;
} }
QWidget* IntensityDataPropertyWidget::createTextEdit(SessionItem* item) QWidget* IntensityDataPropertyWidget::createTextEdit(SessionItem* item,
function<void(QString)> slot)
{ {
auto* edit = new QLineEdit(this); auto* edit = new QLineEdit(this);
connect(edit, &QLineEdit::textEdited, [=](const QString& t) { item->setValue(t); }); connect(edit, &QLineEdit::textEdited, [=](const QString& newText) {
if(slot)
slot(newText);
});
m_updaters << [=]() { edit->setText(item->value().toString()); }; m_updaters << [=]() { edit->setText(item->value().toString()); };
return edit; return edit;
} }
QWidget* IntensityDataPropertyWidget::createCheckBox(const QString& title, SessionItem* item)
{
return createCheckBox(
title, [=]() { return item->value().toBool(); }, [=](bool b) { item->setValue(b); });
}
QWidget* IntensityDataPropertyWidget::createCheckBox(const QString& title, function<bool()> getter, QWidget* IntensityDataPropertyWidget::createCheckBox(const QString& title, function<bool()> getter,
function<void(bool)> setter) function<void(bool)> setter)
{ {
......
...@@ -41,8 +41,7 @@ public: ...@@ -41,8 +41,7 @@ public:
private: private: