X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=pv%2Fprop%2Fbinding%2Fbinding.cpp;h=ec3127254b71c8e82085b4cb0f802020c65e2aa0;hb=636782c1f942d1acdb56a0561c2e0fd52cc39ddb;hp=28a47099144eb8d50883a8d602c2f2d210a56c78;hpb=4206fe26e6b3f6439e382a072f5ff67c009f412a;p=pulseview.git diff --git a/pv/prop/binding/binding.cpp b/pv/prop/binding/binding.cpp index 28a47099..ec312725 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,24 +45,31 @@ void Binding::commit() } } -void Binding::add_properties_to_form(QFormLayout *layout) const +void Binding::add_properties_to_form(QFormLayout *layout, + bool auto_commit) const { 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(layout->parentWidget())); + + QWidget *const widget = p->get_widget(layout->parentWidget(), + auto_commit); + if (p->labeled_widget()) + layout->addRow(widget); + else + layout->addRow(p->name(), widget); } } -QWidget* Binding::get_property_form(QWidget *parent) const +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); + add_properties_to_form(layout, auto_commit); return form; }