X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fprop%2Fbinding%2Fbinding.cpp;fp=pv%2Fprop%2Fbinding%2Fbinding.cpp;h=3c9bba5aee16483c14596def207d5ca6d0b0249b;hp=7d38cb4629b5498c5d9cd0bc92dd4982909b8177;hb=8481fbdf89e8f26a0d5ef0b69e32d25be5e2f6e4;hpb=21ad818feabcb0a1cb51c61c534adce553c7e325;ds=sidebyside diff --git a/pv/prop/binding/binding.cpp b/pv/prop/binding/binding.cpp index 7d38cb46..3c9bba5a 100644 --- a/pv/prop/binding/binding.cpp +++ b/pv/prop/binding/binding.cpp @@ -18,8 +18,16 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + +#include + +#include + #include "binding.h" +using namespace boost; + namespace pv { namespace prop { namespace binding { @@ -29,6 +37,30 @@ const std::vector< boost::shared_ptr >& Binding::properties() return _properties; } +void Binding::commit() +{ + BOOST_FOREACH(shared_ptr p, _properties) { + assert(p); + p->commit(); + } +} + +QWidget* Binding::get_property_form(QWidget *parent) const +{ + QWidget *const form = new QWidget(parent); + QFormLayout *const layout = new QFormLayout(form); + form->setLayout(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)); + } + + return form; +} + } // binding } // prop } // pv