+void Binding::commit()
+{
+ BOOST_FOREACH(shared_ptr<pv::prop::Property> p, _properties) {
+ assert(p);
+ p->commit();
+ }
+}
+
+void Binding::add_properties_to_form(QFormLayout *layout,
+ bool auto_commit) const
+{
+ assert(layout);
+
+ BOOST_FOREACH(shared_ptr<pv::prop::Property> p, _properties)
+ {
+ assert(p);
+
+ 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,
+ 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;
+}
+