X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fprop%2Fbinding%2Fbinding.cpp;h=90e5214e86c08dad3eb208c5b3ccf873e609662a;hb=f45925927eba2b93f367e63f5e3b651e24c67eb3;hp=3c9bba5aee16483c14596def207d5ca6d0b0249b;hpb=8481fbdf89e8f26a0d5ef0b69e32d25be5e2f6e4;p=pulseview.git diff --git a/pv/prop/binding/binding.cpp b/pv/prop/binding/binding.cpp index 3c9bba5a..90e5214e 100644 --- a/pv/prop/binding/binding.cpp +++ b/pv/prop/binding/binding.cpp @@ -26,7 +26,7 @@ #include "binding.h" -using namespace boost; +using boost::shared_ptr; namespace pv { namespace prop { @@ -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; }