X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fprop%2Fbinding%2Fbinding.cpp;h=afdd7030a2a694b889cfe799fcc29cb2edd8c1a2;hb=68162c2925e3c5a3c7d0b4d3d100184e5c649eba;hp=3c9bba5aee16483c14596def207d5ca6d0b0249b;hpb=8481fbdf89e8f26a0d5ef0b69e32d25be5e2f6e4;p=pulseview.git diff --git a/pv/prop/binding/binding.cpp b/pv/prop/binding/binding.cpp index 3c9bba5a..afdd7030 100644 --- a/pv/prop/binding/binding.cpp +++ b/pv/prop/binding/binding.cpp @@ -45,19 +45,27 @@ void Binding::commit() } } -QWidget* Binding::get_property_form(QWidget *parent) const +void Binding::add_properties_to_form(QFormLayout *layout, + bool auto_commit) const { - QWidget *const form = new QWidget(parent); - QFormLayout *const layout = new QFormLayout(form); - form->setLayout(layout); + assert(layout); BOOST_FOREACH(shared_ptr p, _properties) { assert(p); const QString label = p->labeled_widget() ? QString() : p->name(); - layout->addRow(label, p->get_widget(form)); + layout->addRow(label, p->get_widget(layout->parentWidget(), + auto_commit)); } +} +QWidget* Binding::get_property_form(QWidget *parent, + bool auto_commit) const +{ + QWidget *const form = new QWidget(parent); + QFormLayout *const layout = new QFormLayout(form); + form->setLayout(layout); + add_properties_to_form(layout, auto_commit); return form; }