fix apply button being erroneously available

This commit is contained in:
Jussi Kuokkanen 2023-09-04 19:58:14 +03:00
parent af78bd795b
commit 7d2dce5e6c
2 changed files with 7 additions and 1 deletions

View File

@ -97,8 +97,10 @@ bool DeviceModelDelegate::editorEvent(QEvent *event, QAbstractItemModel *model,
// Context menu handling
if (event->type() == QEvent::MouseButtonRelease) {
// Disconnect so all the previous context menu actions don't go off
// Private signals also get disconnected if we don't specify any signal
if (m_functionEditor)
disconnect(m_functionEditor, nullptr, nullptr, nullptr);
disconnect(m_functionEditor, &FunctionEditor::connectionDataChanged,
nullptr, nullptr);
disconnect(m_parametrize, nullptr, nullptr, nullptr);
disconnect(m_resetAssignable, nullptr, nullptr, nullptr);
m_menu.clear();

View File

@ -117,6 +117,10 @@ public:
}
// Somehow existing points disappear somewhere in these two?
void setRangeInfo(TuxClocker::Device::RangeInfo rangeInfo) {
// HACK: points get deleted somwhere when requesting editor
// for another node, but DragChartView::pointsChanged doesn't fire -_-
emit canApplyChanged(false);
p::match(rangeInfo)(
p::pattern(p::as<TuxClocker::Device::Range<double>>(p::arg)) =
[this](auto dr) { m_dragView->setRange(0, 100, dr.min, dr.max); },